diff options
author | Domen Kožar <domen@dev.si> | 2015-01-24 07:11:16 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2015-01-24 07:11:16 +0100 |
commit | cb7cd012df2ba77510a198dff136e895df2cc683 (patch) | |
tree | 44fff0be62c74ee6d6f613d320ddee7576a15678 /nixos | |
parent | fde45d217e6f8e74d23576a0181f9b5831d02dfc (diff) | |
parent | 2aaeacc57923db53a18db6f089d6da9b86f5a9b8 (diff) | |
download | nixlib-cb7cd012df2ba77510a198dff136e895df2cc683.tar nixlib-cb7cd012df2ba77510a198dff136e895df2cc683.tar.gz nixlib-cb7cd012df2ba77510a198dff136e895df2cc683.tar.bz2 nixlib-cb7cd012df2ba77510a198dff136e895df2cc683.tar.lz nixlib-cb7cd012df2ba77510a198dff136e895df2cc683.tar.xz nixlib-cb7cd012df2ba77510a198dff136e895df2cc683.tar.zst nixlib-cb7cd012df2ba77510a198dff136e895df2cc683.zip |
Merge pull request #5593 from abbradar/modprobe-fix
modprobe: wrap all of kmod
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/system/boot/modprobe.nix | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/nixos/modules/system/boot/modprobe.nix b/nixos/modules/system/boot/modprobe.nix index eaf8cf1ecd6f..a1feaad6132d 100644 --- a/nixos/modules/system/boot/modprobe.nix +++ b/nixos/modules/system/boot/modprobe.nix @@ -10,10 +10,18 @@ with lib; system.sbin.modprobe = mkOption { internal = true; - default = pkgs.writeTextFile { + default = pkgs.stdenv.mkDerivation { name = "modprobe"; - destination = "/sbin/modprobe"; - executable = true; + buildCommand = '' + mkdir -p $out/bin + for i in ${pkgs.kmod}/sbin/*; do + name=$(basename $i) + echo "$text" > $out/bin/$name + echo 'exec '$i' "$@"' >> $out/bin/$name + chmod +x $out/bin/$name + done + ln -s bin $out/sbin + ''; text = '' #! ${pkgs.stdenv.shell} @@ -26,7 +34,6 @@ with lib; MODULE_DIR=/run/booted-system/kernel-modules/lib/modules/ fi - exec ${pkgs.kmod}/sbin/modprobe "$@" ''; }; description = '' |