this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add 45-apple TLP script as overlay

+25 -25
+25 -25
.config/nixos/prismo/configuration.nix
··· 1 1 # To apply this file, symlink this directory to /etc/nixos 2 2 # E.g. `rm -rf /etc/nixos && ln -s $PWD /etc/nixos` 3 3 { config, lib, pkgs, ... }: 4 + let 5 + applesmc-next = with config.boot.kernelPackages; 6 + callPackage ./applesmc-next.nix {}; 7 + in 4 8 { 5 9 imports = 6 10 [ ··· 22 26 efi.canTouchEfiVariables = true; 23 27 }; 24 28 25 - extraModulePackages = 26 - let 27 - applesmc-next = with config.boot.kernelPackages; 28 - # Set custom kernel modules to be higher priority, so they override 29 - # default kernel module files (which seem to have priority 0) 30 - lib.meta.hiPrio (callPackage ./applesmc-next.nix {}); 31 - in 32 - [ applesmc-next ]; 29 + extraModulePackages = [ 30 + # Set custom kernel modules to be higher priority, so they override 31 + # default kernel module files (which seem to have priority 0) 32 + (lib.meta.hiPrio applesmc-next) 33 + ]; 33 34 34 35 # I think these might autoload anyway but let's load explicitly just in case 35 36 kernelModules = [ "applesmc" "sbs" ]; ··· 129 130 # verbose = true; 130 131 }; 131 132 132 - /* # TODO: needs applesmc-next helper script for thresholds to work 133 + # NOTE: this requires applesmc-next for kernel modules and TLP script 133 134 services.tlp = { 134 135 enable = true; 135 136 settings = { 136 - CPU_SCALING_GOVERNOR_ON_AC = "performance"; 137 - CPU_SCALING_GOVERNOR_ON_BAT = "performance"; 138 - 139 - CPU_ENERGY_PERF_POLICY_ON_BAT = "power"; 140 - CPU_ENERGY_PERF_POLICY_ON_AC = "performance"; 141 - 142 - CPU_MIN_PERF_ON_AC = 0; 143 - CPU_MAX_PERF_ON_AC = 100; 144 - CPU_MIN_PERF_ON_BAT = 0; 145 - CPU_MAX_PERF_ON_BAT = 20; 146 - 147 - # Optional helps save long term battery health 148 - START_CHARGE_THRESH_BAT0 = 5; 149 - STOP_CHARGE_THRESH_BAT0 = 95; 137 + START_CHARGE_THRESH_BAT0 = 0; 138 + STOP_CHARGE_THRESH_BAT0 = 65; 150 139 }; 151 140 }; 152 - */ 153 141 154 142 services.devmon.enable = true; 155 143 ··· 161 149 # Allow unfree software (required for some drivers) 162 150 nixpkgs.config.allowUnfree = true; 163 151 152 + nixpkgs.overlays = [ 153 + (final: prev: { 154 + tlp = prev.tlp.overrideAttrs (prev': { 155 + buildInputs = prev'.buildInputs ++ [ applesmc-next ]; 156 + postUnpack = (prev'.postUnpack or "") + "\n" + 157 + '' 158 + mkdir -p bat.d/ 159 + cp ${applesmc-next.src.outPath}/45-apple $sourceRoot/bat.d/ 160 + ''; 161 + }); 162 + }) 163 + ]; 164 + 164 165 # List packages installed in system profile. To search, run: 165 166 # $ nix search wget 166 167 environment.systemPackages = with pkgs; [ ··· 172 173 lm_sensors 173 174 nixos-option 174 175 powertop 175 - tlp 176 176 vim 177 177 wget 178 178 ];