diff options
author | Periklis Tsirakidis <periklis.tsirakidis@holidaycheck.com> | 2019-08-03 19:41:52 +0200 |
---|---|---|
committer | Periklis Tsirakidis <periklis.tsirakidis@holidaycheck.com> | 2019-08-09 09:22:38 +0200 |
commit | 95dec03601c003c372ea077ae359cb87ad89ce52 (patch) | |
tree | 7b47dc2f78f293ba37efec28ed8e118ab1194c38 | |
parent | 62a916defd4c650b87fdef07c9a8d937d1069cfe (diff) |
[throttled] Enable custom config
-rw-r--r-- | nixos/modules/services/hardware/throttled.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/services/hardware/throttled.nix b/nixos/modules/services/hardware/throttled.nix index cd5b01450e44..13fc5e4792e6 100644 --- a/nixos/modules/services/hardware/throttled.nix +++ b/nixos/modules/services/hardware/throttled.nix @@ -8,6 +8,12 @@ in { options = { services.throttled = { enable = mkEnableOption "fix for Intel CPU throttling"; + + extraConfig = mkOption { + type = types.str; + default = ""; + description = "Alternative configuration"; + }; }; }; @@ -16,6 +22,9 @@ in { # The upstream package has this in Install, but that's not enough, see the NixOS manual systemd.services."lenovo_fix".wantedBy = [ "multi-user.target" ]; - environment.etc."lenovo_fix.conf".source = "${pkgs.throttled}/etc/lenovo_fix.conf"; + environment.etc."lenovo_fix.conf".source = + if cfg.extraConfig != "" + then pkgs.writeText "lenovo_fix.conf" cfg.extraConfig + else "${pkgs.throttled}/etc/lenovo_fix.conf"; }; } |