Restructured NixOS system configurations to be more modularized
This commit is contained in:
parent
4326a51ef7
commit
4cf7c21ed8
6 changed files with 94 additions and 176 deletions
8
.config/nix/modules/efi.nix
Normal file
8
.config/nix/modules/efi.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{ config, pkgs, inputs, ... }
|
||||
|
||||
{
|
||||
# SystemD-boot is good enough
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
systemd.tpm2.enable = false;
|
||||
}
|
||||
29
.config/nix/modules/hypr.nix
Normal file
29
.config/nix/modules/hypr.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ config, pkgs, inputs, ... }
|
||||
|
||||
{
|
||||
# Hyprland looks nice so I'm using it
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
xwayland.enable = true;
|
||||
};
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
xdg.portal.enable = true;
|
||||
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# home-manager # For using Nix Home Manager
|
||||
zsh # Default user shell
|
||||
neovim # Terminal text editor
|
||||
wget # coreutil for some script compatibility
|
||||
waybar # Status bar
|
||||
libnotify # Desktop notifications
|
||||
swww # Wallpaper manager
|
||||
brightnessctl # For laptop backlight brightness control
|
||||
grim # screenshot utility
|
||||
slurp # select utility
|
||||
wl-clipboard # xclip alternative
|
||||
rofi-wayland # Dmenu replacement for Wayland
|
||||
ghostty # Terminal emulator
|
||||
];
|
||||
}
|
||||
36
.config/nix/modules/laptop.nix
Normal file
36
.config/nix/modules/laptop.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ config, lib, pkgs, inputs, ...}:
|
||||
|
||||
{
|
||||
services.libinput.enable = true; # for laptop touchpad
|
||||
# Laptop battery optimizations
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
|
||||
CPU_MIN_PERF_ON_AC = 0;
|
||||
CPU_MAX_PERF_ON_AC = 100;
|
||||
CPU_MIN_PERF_ON_BAT = 0;
|
||||
CPU_MAX_PERF_ON_BAT = 20;
|
||||
|
||||
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
|
||||
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
|
||||
};
|
||||
};
|
||||
services.auto-cpufreq.enable = true;
|
||||
services.auto-cpufreq.settings = {
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
turbo = "never";
|
||||
};
|
||||
charger = {
|
||||
governor = "performance";
|
||||
turbo = "auto";
|
||||
};
|
||||
};
|
||||
powerManagement.powertop.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue