From 0ff76742e27f2f3c57b0a67c16002fbeb6a994ba Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 27 Jul 2021 00:33:10 +0200 Subject: [PATCH] zephyrus: enable tlp service and hardware module --- flake.lock | 17 +++++++++++++++++ flake.nix | 11 +++++++++++ hosts/zephyrus/default.nix | 9 +++++++++ hosts/zephyrus/hardware-configuration.nix | 2 ++ 4 files changed, 39 insertions(+) diff --git a/flake.lock b/flake.lock index 5ad2d69..6622494 100644 --- a/flake.lock +++ b/flake.lock @@ -53,6 +53,22 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1627212500, + "narHash": "sha256-KMUQCT3JSqznp+dR6BTvbwLqPFErjNlotVpkp/P/ZmM=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "03e7686c72345f237405c0b46b153dccd3ec9913", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1627131378, @@ -90,6 +106,7 @@ "emacs-overlay": "emacs-overlay", "flake-utils": "flake-utils", "home-manager": "home-manager", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" } diff --git a/flake.nix b/flake.nix index 3176f82..c47d331 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,13 @@ repo = "flake-utils"; ref = "master"; }; + + nixos-hardware = { + type = "github"; + owner = "NixOS"; + repo = "nixos-hardware"; + ref = "master"; + }; }; outputs = { self, nixpkgs, home-manager, ... } @inputs: { @@ -123,6 +130,10 @@ modules = [ ./zephyrus.nix + inputs.nixos-hardware.nixosModules.common-cpu-intel + inputs.nixos-hardware.nixosModules.common-pc-laptop + inputs.nixos-hardware.nixosModules.common-pc-ssd + home-manager.nixosModule self.nixosModules.home diff --git a/hosts/zephyrus/default.nix b/hosts/zephyrus/default.nix index 83f7a0c..68add65 100644 --- a/hosts/zephyrus/default.nix +++ b/hosts/zephyrus/default.nix @@ -53,6 +53,15 @@ in xkbVariant = "us"; libinput.enable = true; }; + tlp = { + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + START_CHARGE_THRESH_BAT0 = 70; + STOP_CHARGE_THRESH_BAT0 = 80; + }; + }; }; my.displayManager.sddm.enable = true; diff --git a/hosts/zephyrus/hardware-configuration.nix b/hosts/zephyrus/hardware-configuration.nix index 6808322..cc55acf 100644 --- a/hosts/zephyrus/hardware-configuration.nix +++ b/hosts/zephyrus/hardware-configuration.nix @@ -41,4 +41,6 @@ swapDevices = [ ]; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + + hardware.enableRedistributableFirmware = true; }