move power management options to laptop flake

This commit is contained in:
lucy 2026-07-18 21:05:06 +02:00
commit 782387d9dd
4 changed files with 16 additions and 106 deletions

View file

@ -8,7 +8,7 @@
imports = [ imports = [
./stylix.nix ./stylix.nix
./nixvim/nixvim.nix ./nixvim/nixvim.nix
/etc/nixos/hardware-configuration.nix
]; ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
@ -36,26 +36,11 @@
LC_TELEPHONE = "de_DE.UTF-8"; LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8"; LC_TIME = "de_DE.UTF-8";
}; };
services.upower.enable = true;
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 20;
};
};
services.xserver.xkb = { services.xserver.xkb = {
layout = "eu"; layout = "eu";
variant = ""; variant = "";
}; };
services.displayManager.ly.enable = true; services.displayManager.ly.enable = true;
powerManagement.powertop.enable = true;
programs.hyprland = { programs.hyprland = {
package = pkgs.hyprland; package = pkgs.hyprland;
enable = true; enable = true;

View file

@ -57,10 +57,21 @@
} }
({ lib, ... }: { ({ lib, ... }: {
networking.hostName = lib.mkForce "seele"; networking.hostName = lib.mkForce "seele";
imports = [ powerManagement.powertop.enable = true;
./hardware-configuration-laptop.nix services.upower.enable = true;
]; services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 20;
};
};
}) })
]; ];
@ -82,9 +93,6 @@
} }
({ pkgs, lib, ... }: { ({ pkgs, lib, ... }: {
imports = [
./hardware-configuration-desktop.nix
];
networking.hostName = lib.mkForce "nerv"; networking.hostName = lib.mkForce "nerv";
environment.systemPackages = [ environment.systemPackages = [
# For debugging and troubleshooting Secure Boot. # For debugging and troubleshooting Secure Boot.

View file

@ -1,50 +0,0 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"nvme"
"ahci"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/64a37727-0c5f-41d4-afac-dc26978916c1";
fsType = "xfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/F424-0E3E";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.open = true; # see the note above
boot.loader.systemd-boot.configurationLimit = 5;
}

View file

@ -1,33 +0,0 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/624609f3-6d1c-4e9c-adcb-0c4d66de25c3";
fsType = "xfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/298C-5081";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/9d98be55-ea0d-465f-967e-29c83c4127a9"; }
];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}