From 9a529d3bbe006ccb4fdaf0450a70ff6e1400d832 Mon Sep 17 00:00:00 2001 From: Patrick Balsiger Date: Tue, 27 Aug 2024 13:36:54 +0200 Subject: [PATCH] Add power management --- os/configuration.nix | 4 ---- os/hardware/lenovo-thinkpad-e14.nix | 1 + os/system/packages.nix | 15 +++++++++++++-- os/users/master.nix | 1 + 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/os/configuration.nix b/os/configuration.nix index 2b303e2..7b8de4f 100644 --- a/os/configuration.nix +++ b/os/configuration.nix @@ -11,8 +11,4 @@ system.stateVersion = "23.05"; - nixpkgs.config.permittedInsecurePackages = [ - "electron-24.8.6" - ]; - } diff --git a/os/hardware/lenovo-thinkpad-e14.nix b/os/hardware/lenovo-thinkpad-e14.nix index 9e68741..37e177e 100644 --- a/os/hardware/lenovo-thinkpad-e14.nix +++ b/os/hardware/lenovo-thinkpad-e14.nix @@ -38,6 +38,7 @@ # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.enable = true; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.bluetooth.enable = true; diff --git a/os/system/packages.nix b/os/system/packages.nix index 6b964db..6ddc90c 100644 --- a/os/system/packages.nix +++ b/os/system/packages.nix @@ -1,7 +1,12 @@ { pkgs, ... }: { - nixpkgs.config.allowUnfree = true; - + nixpkgs.config = { + allowUnfree = true; + permittedInsecurePackages = [ + "electron-24.8.6" + ]; + }; + home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; @@ -39,4 +44,10 @@ services.logind.extraConfig = '' RuntimeDirectorySize=20G ''; + systemd.sleep.extraConfig = '' + AllowSuspend=yes + AllowHibernation=yes + AllowHybridSleep=yes + AllowSuspendThenHibernate=yes + ''; } diff --git a/os/users/master.nix b/os/users/master.nix index 50f90dd..49542a1 100644 --- a/os/users/master.nix +++ b/os/users/master.nix @@ -39,6 +39,7 @@ imagemagick ledger-live-desktop solana-cli + sqlite ]; programs = {