tlp: use module_init_tools, avoid recompilation for nixos

This commit is contained in:
Nikolay Amiantov 2015-12-05 00:28:29 +03:00
parent 87ba86b7da
commit ae7ff02081
2 changed files with 6 additions and 3 deletions

View File

@ -10,7 +10,6 @@ enableRDW = config.networking.networkmanager.enable;
tlp = pkgs.tlp.override {
inherit enableRDW;
kmod = config.system.sbin.modprobe;
};
# XXX: We can't use writeTextFile + readFile here because it triggers
@ -69,6 +68,8 @@ in
ExecStart = "${tlp}/bin/tlp init start";
ExecStop = "${tlp}/bin/tlp init stop";
};
environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/";
};
tlp-sleep = {
@ -87,6 +88,8 @@ in
ExecStart = "${tlp}/bin/tlp suspend";
ExecStop = "${tlp}/bin/tlp resume";
};
environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/";
};
};

View File

@ -1,5 +1,5 @@
{ stdenv, lib, fetchFromGitHub, makeWrapper, perl, systemd, iw, rfkill, hdparm, ethtool, inetutils
, kmod, pciutils, smartmontools, x86_energy_perf_policy
, module_init_tools, pciutils, smartmontools, x86_energy_perf_policy
, enableRDW ? false, networkmanager
}:
@ -27,7 +27,7 @@ in stdenv.mkDerivation {
buildInputs = [ perl ];
paths = lib.makeSearchPath "bin"
([ iw rfkill hdparm ethtool inetutils systemd kmod pciutils smartmontools
([ iw rfkill hdparm ethtool inetutils systemd module_init_tools pciutils smartmontools
x86_energy_perf_policy
]
++ lib.optional enableRDW networkmanager