Personal-use NixOS configuration

Replace laptop module with battery

+17 -13
+14
hardware/battery.nix
··· 1 + { 2 + config, 3 + lib, 4 + pkgs, 5 + ... 6 + }: 7 + 8 + { 9 + # https://gist.github.com/balacij/492d27776ad7d3cde3e0b0ce0bc3a3f8/11a61171828fa0f76cd403686773c3d455d2c652 10 + services.udev.extraRules = lib.mkIf config.services.desktopManager.gnome.enable '' 11 + SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set power-saver" 12 + SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set performance" 13 + ''; 14 + }
-2
hardware/cpu/amd.nix
··· 2 2 3 3 { 4 4 imports = [ 5 - ./common.nix 6 - 7 5 nixos-hardware.nixosModules.common-cpu-amd 8 6 ]; 9 7
-5
hardware/cpu/common.nix
··· 1 - { isLaptop, ... }: 2 - 3 - { 4 - #services.auto-cpufreq.enable = isLaptop; # TODO 5 - }
-2
hardware/cpu/intel.nix
··· 6 6 7 7 { 8 8 imports = [ 9 - ./common.nix 10 - 11 9 nixos-hardware.nixosModules.common-cpu-intel 12 10 ]; 13 11
-3
hardware/laptop.nix
··· 1 - { 2 - # TODO: Power management, mostly 3 - }
+3 -1
lib/mkSystem.nix
··· 49 49 } 50 50 ] 51 51 ++ builtins.attrValues inputs.encode42-packages.nixosModules 52 - ++ lib.optional isLaptop ../hardware/laptop.nix 52 + ++ lib.optionals isLaptop [ 53 + ../hardware/battery.nix 54 + ] 53 55 ++ extraModules; 54 56 55 57 specialArgs = {