modprobe service: drop kmod wrapper

+8 -43
+1 -1
nixos/modules/config/zram.nix
··· 8 9 devices = map (nr: "zram${toString nr}") (range 0 (cfg.numDevices - 1)); 10 11 - modprobe = "${config.system.sbin.modprobe}/sbin/modprobe"; 12 13 in 14
··· 8 9 devices = map (nr: "zram${toString nr}") (range 0 (cfg.numDevices - 1)); 10 11 + modprobe = "${pkgs.kmod}/bin/modprobe"; 12 13 in 14
+1 -1
nixos/modules/services/hardware/udev.nix
··· 58 # Fix some paths in the standard udev rules. Hacky. 59 for i in $out/*.rules; do 60 substituteInPlace $i \ 61 - --replace \"/sbin/modprobe \"${config.system.sbin.modprobe}/sbin/modprobe \ 62 --replace \"/sbin/mdadm \"${pkgs.mdadm}/sbin/mdadm \ 63 --replace \"/sbin/blkid \"${pkgs.utillinux}/sbin/blkid \ 64 --replace \"/bin/mount \"${pkgs.utillinux}/bin/mount \
··· 58 # Fix some paths in the standard udev rules. Hacky. 59 for i in $out/*.rules; do 60 substituteInPlace $i \ 61 + --replace \"/sbin/modprobe \"${pkgs.kmod}/bin/modprobe \ 62 --replace \"/sbin/mdadm \"${pkgs.mdadm}/sbin/mdadm \ 63 --replace \"/sbin/blkid \"${pkgs.utillinux}/sbin/blkid \ 64 --replace \"/bin/mount \"${pkgs.utillinux}/bin/mount \
+1 -1
nixos/modules/services/networking/fan.nix
··· 5 let 6 7 cfg = config.networking.fan; 8 - modprobe = "${config.system.sbin.modprobe}/sbin/modprobe"; 9 10 in 11
··· 5 let 6 7 cfg = config.networking.fan; 8 + modprobe = "${pkgs.kmod}/bin/modprobe"; 9 10 in 11
+1 -1
nixos/modules/services/networking/strongswan.nix
··· 118 systemd.services.strongswan = { 119 description = "strongSwan IPSec Service"; 120 wantedBy = [ "multi-user.target" ]; 121 - path = with pkgs; [ config.system.sbin.modprobe iproute iptables utillinux ]; # XXX Linux 122 wants = [ "keys.target" ]; 123 after = [ "network.target" "keys.target" ]; 124 environment = {
··· 118 systemd.services.strongswan = { 119 description = "strongSwan IPSec Service"; 120 wantedBy = [ "multi-user.target" ]; 121 + path = with pkgs; [ kmod iproute iptables utillinux ]; # XXX Linux 122 wants = [ "keys.target" ]; 123 after = [ "network.target" "keys.target" ]; 124 environment = {
+2 -37
nixos/modules/system/boot/modprobe.nix
··· 8 9 options = { 10 11 - system.sbin.modprobe = mkOption { 12 - internal = true; 13 - default = pkgs.stdenv.mkDerivation { 14 - name = "modprobe"; 15 - buildCommand = '' 16 - mkdir -p $out/bin 17 - for i in ${pkgs.kmod}/sbin/*; do 18 - name=$(basename $i) 19 - echo "$text" > $out/bin/$name 20 - echo 'exec '$i' "$@"' >> $out/bin/$name 21 - chmod +x $out/bin/$name 22 - done 23 - ln -s bin $out/sbin 24 - ''; 25 - text = 26 - '' 27 - #! ${pkgs.stdenv.shell} 28 - export MODULE_DIR=/run/current-system/kernel-modules/lib/modules 29 - 30 - # Fall back to the kernel modules used at boot time if the 31 - # modules in the current configuration don't match the 32 - # running kernel. 33 - if [ ! -d "$MODULE_DIR/$(${pkgs.coreutils}/bin/uname -r)" ]; then 34 - MODULE_DIR=/run/booted-system/kernel-modules/lib/modules/ 35 - fi 36 - 37 - ''; 38 - meta.priority = 4; 39 - }; 40 - description = '' 41 - Wrapper around modprobe that sets the path to the modules 42 - tree. 43 - ''; 44 - }; 45 - 46 boot.blacklistedKernelModules = mkOption { 47 type = types.listOf types.str; 48 default = []; ··· 87 ''; 88 environment.etc."modprobe.d/debian.conf".source = pkgs.kmod-debian-aliases; 89 90 - environment.systemPackages = [ config.system.sbin.modprobe pkgs.kmod ]; 91 92 system.activationScripts.modprobe = 93 '' ··· 95 # in the right location in the Nix store for kernel modules). 96 # We need this when the kernel (or some module) auto-loads a 97 # module. 98 - echo ${config.system.sbin.modprobe}/sbin/modprobe > /proc/sys/kernel/modprobe 99 ''; 100 101 environment.sessionVariables.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules";
··· 8 9 options = { 10 11 boot.blacklistedKernelModules = mkOption { 12 type = types.listOf types.str; 13 default = []; ··· 52 ''; 53 environment.etc."modprobe.d/debian.conf".source = pkgs.kmod-debian-aliases; 54 55 + environment.systemPackages = [ pkgs.kmod ]; 56 57 system.activationScripts.modprobe = 58 '' ··· 60 # in the right location in the Nix store for kernel modules). 61 # We need this when the kernel (or some module) auto-loads a 62 # module. 63 + echo ${pkgs.kmod}/bin/modprobe > /proc/sys/kernel/modprobe 64 ''; 65 66 environment.sessionVariables.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules";
+1 -1
nixos/modules/tasks/cpu-freq.nix
··· 38 description = "CPU Frequency Governor Setup"; 39 after = [ "systemd-modules-load.service" ]; 40 wantedBy = [ "multi-user.target" ]; 41 - path = [ cpupower config.system.sbin.modprobe ]; 42 unitConfig.ConditionVirtualization = false; 43 serviceConfig = { 44 Type = "oneshot";
··· 38 description = "CPU Frequency Governor Setup"; 39 after = [ "systemd-modules-load.service" ]; 40 wantedBy = [ "multi-user.target" ]; 41 + path = [ cpupower pkgs.kmod ]; 42 unitConfig.ConditionVirtualization = false; 43 serviceConfig = { 44 Type = "oneshot";
+1 -1
nixos/modules/virtualisation/docker.nix
··· 95 LimitNPROC = 1048576; 96 } // proxy_env; 97 98 - path = [ config.system.sbin.modprobe ] ++ (optional (cfg.storageDriver == "zfs") pkgs.zfs); 99 environment.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules"; 100 101 postStart = if cfg.socketActivation then "" else cfg.postStart;
··· 95 LimitNPROC = 1048576; 96 } // proxy_env; 97 98 + path = [ pkgs.kmod ] ++ (optional (cfg.storageDriver == "zfs") pkgs.zfs); 99 environment.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules"; 100 101 postStart = if cfg.socketActivation then "" else cfg.postStart;