summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2015-11-05 16:21:47 +0300
committerNikolay Amiantov <ab@fmap.me>2015-11-05 16:22:10 +0300
commit452dbfd2886038f230cd182e601b9d311312e0b0 (patch)
treee0ef817687b6be3bc60e5eca10560444c57b71e5 /nixos
parent43147bedaba012a970dfcd22948b99d1d833ecfa (diff)
downloadnixpkgs-452dbfd2886038f230cd182e601b9d311312e0b0.tar
nixpkgs-452dbfd2886038f230cd182e601b9d311312e0b0.tar.gz
nixpkgs-452dbfd2886038f230cd182e601b9d311312e0b0.tar.bz2
nixpkgs-452dbfd2886038f230cd182e601b9d311312e0b0.tar.lz
nixpkgs-452dbfd2886038f230cd182e601b9d311312e0b0.tar.xz
nixpkgs-452dbfd2886038f230cd182e601b9d311312e0b0.tar.zst
nixpkgs-452dbfd2886038f230cd182e601b9d311312e0b0.zip
nixos/tlp: workaround early build trigger
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/hardware/tlp.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/services/hardware/tlp.nix b/nixos/modules/services/hardware/tlp.nix
index f221c82e2ed..9bd246bfb63 100644
--- a/nixos/modules/services/hardware/tlp.nix
+++ b/nixos/modules/services/hardware/tlp.nix
@@ -8,7 +8,16 @@ cfg = config.services.tlp;
 
 tlp = pkgs.tlp.override { kmod = config.system.sbin.modprobe; };
 
-confFile = pkgs.writeText "tlp" (builtins.readFile "${tlp}/etc/default/tlp" + cfg.extraConfig);
+# XXX: We can't use writeTextFile + readFile here because it triggers
+# TLP build to get the .drv (even on --dry-run).
+confFile = pkgs.runCommand "tlp"
+  { config = cfg.extraConfig;
+    passAsFile = [ "config" ];
+  }
+  ''
+    cat ${tlp}/etc/default/tlp > $out
+    cat $configPath >> $out
+  '';
 
 in