summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-08-14 13:00:52 +0300
committerNikolay Amiantov <ab@fmap.me>2016-08-19 17:56:49 +0300
commit5ff6e98486adb1a3ff3f705bdc43216d3a885d73 (patch)
treee8e36c540e783fec13775b2a68ba72e7d1881e3d
parentff227057931f5977352f7583b00f9d1f8cf43da5 (diff)
downloadnixpkgs-5ff6e98486adb1a3ff3f705bdc43216d3a885d73.tar
nixpkgs-5ff6e98486adb1a3ff3f705bdc43216d3a885d73.tar.gz
nixpkgs-5ff6e98486adb1a3ff3f705bdc43216d3a885d73.tar.bz2
nixpkgs-5ff6e98486adb1a3ff3f705bdc43216d3a885d73.tar.lz
nixpkgs-5ff6e98486adb1a3ff3f705bdc43216d3a885d73.tar.xz
nixpkgs-5ff6e98486adb1a3ff3f705bdc43216d3a885d73.tar.zst
nixpkgs-5ff6e98486adb1a3ff3f705bdc43216d3a885d73.zip
modprobe service: drop kmod wrapper
-rw-r--r--nixos/modules/config/zram.nix2
-rw-r--r--nixos/modules/services/hardware/udev.nix2
-rw-r--r--nixos/modules/services/networking/fan.nix2
-rw-r--r--nixos/modules/services/networking/strongswan.nix2
-rw-r--r--nixos/modules/system/boot/modprobe.nix39
-rw-r--r--nixos/modules/tasks/cpu-freq.nix2
-rw-r--r--nixos/modules/virtualisation/docker.nix2
7 files changed, 8 insertions, 43 deletions
diff --git a/nixos/modules/config/zram.nix b/nixos/modules/config/zram.nix
index 019932b04e8..ad41ad4f3d7 100644
--- a/nixos/modules/config/zram.nix
+++ b/nixos/modules/config/zram.nix
@@ -8,7 +8,7 @@ let
 
   devices = map (nr: "zram${toString nr}") (range 0 (cfg.numDevices - 1));
 
-  modprobe = "${config.system.sbin.modprobe}/sbin/modprobe";
+  modprobe = "${pkgs.kmod}/bin/modprobe";
 
 in
 
diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix
index e7741083d1a..fb44790ab1f 100644
--- a/nixos/modules/services/hardware/udev.nix
+++ b/nixos/modules/services/hardware/udev.nix
@@ -58,7 +58,7 @@ let
       # Fix some paths in the standard udev rules.  Hacky.
       for i in $out/*.rules; do
         substituteInPlace $i \
-          --replace \"/sbin/modprobe \"${config.system.sbin.modprobe}/sbin/modprobe \
+          --replace \"/sbin/modprobe \"${pkgs.kmod}/bin/modprobe \
           --replace \"/sbin/mdadm \"${pkgs.mdadm}/sbin/mdadm \
           --replace \"/sbin/blkid \"${pkgs.utillinux}/sbin/blkid \
           --replace \"/bin/mount \"${pkgs.utillinux}/bin/mount \
diff --git a/nixos/modules/services/networking/fan.nix b/nixos/modules/services/networking/fan.nix
index 3170567e5b4..7f4e3647832 100644
--- a/nixos/modules/services/networking/fan.nix
+++ b/nixos/modules/services/networking/fan.nix
@@ -5,7 +5,7 @@ with lib;
 let
 
   cfg = config.networking.fan;
-  modprobe = "${config.system.sbin.modprobe}/sbin/modprobe";
+  modprobe = "${pkgs.kmod}/bin/modprobe";
 
 in
 
diff --git a/nixos/modules/services/networking/strongswan.nix b/nixos/modules/services/networking/strongswan.nix
index d6960a5df47..8778b0364f9 100644
--- a/nixos/modules/services/networking/strongswan.nix
+++ b/nixos/modules/services/networking/strongswan.nix
@@ -118,7 +118,7 @@ in
     systemd.services.strongswan = {
       description = "strongSwan IPSec Service";
       wantedBy = [ "multi-user.target" ];
-      path = with pkgs; [ config.system.sbin.modprobe iproute iptables utillinux ]; # XXX Linux
+      path = with pkgs; [ kmod iproute iptables utillinux ]; # XXX Linux
       wants = [ "keys.target" ];
       after = [ "network.target" "keys.target" ];
       environment = {
diff --git a/nixos/modules/system/boot/modprobe.nix b/nixos/modules/system/boot/modprobe.nix
index 9bb10eac988..91f440535a4 100644
--- a/nixos/modules/system/boot/modprobe.nix
+++ b/nixos/modules/system/boot/modprobe.nix
@@ -8,41 +8,6 @@ with lib;
 
   options = {
 
-    system.sbin.modprobe = mkOption {
-      internal = true;
-      default = pkgs.stdenv.mkDerivation {
-        name = "modprobe";
-        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}
-            export MODULE_DIR=/run/current-system/kernel-modules/lib/modules
-
-            # Fall back to the kernel modules used at boot time if the
-            # modules in the current configuration don't match the
-            # running kernel.
-            if [ ! -d "$MODULE_DIR/$(${pkgs.coreutils}/bin/uname -r)" ]; then
-                MODULE_DIR=/run/booted-system/kernel-modules/lib/modules/
-            fi
-
-          '';
-        meta.priority = 4;
-      };
-      description = ''
-        Wrapper around modprobe that sets the path to the modules
-        tree.
-      '';
-    };
-
     boot.blacklistedKernelModules = mkOption {
       type = types.listOf types.str;
       default = [];
@@ -87,7 +52,7 @@ with lib;
       '';
     environment.etc."modprobe.d/debian.conf".source = pkgs.kmod-debian-aliases;
 
-    environment.systemPackages = [ config.system.sbin.modprobe pkgs.kmod ];
+    environment.systemPackages = [ pkgs.kmod ];
 
     system.activationScripts.modprobe =
       ''
@@ -95,7 +60,7 @@ with lib;
         # in the right location in the Nix store for kernel modules).
         # We need this when the kernel (or some module) auto-loads a
         # module.
-        echo ${config.system.sbin.modprobe}/sbin/modprobe > /proc/sys/kernel/modprobe
+        echo ${pkgs.kmod}/bin/modprobe > /proc/sys/kernel/modprobe
       '';
 
     environment.sessionVariables.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules";
diff --git a/nixos/modules/tasks/cpu-freq.nix b/nixos/modules/tasks/cpu-freq.nix
index 1f4d1db33ce..2fe7f4f8197 100644
--- a/nixos/modules/tasks/cpu-freq.nix
+++ b/nixos/modules/tasks/cpu-freq.nix
@@ -38,7 +38,7 @@ in
       description = "CPU Frequency Governor Setup";
       after = [ "systemd-modules-load.service" ];
       wantedBy = [ "multi-user.target" ];
-      path = [ cpupower config.system.sbin.modprobe ];
+      path = [ cpupower pkgs.kmod ];
       unitConfig.ConditionVirtualization = false;
       serviceConfig = {
         Type = "oneshot";
diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix
index c99fc78d49e..97b2927cf1b 100644
--- a/nixos/modules/virtualisation/docker.nix
+++ b/nixos/modules/virtualisation/docker.nix
@@ -95,7 +95,7 @@ in
           LimitNPROC = 1048576;
         } // proxy_env;
 
-        path = [ config.system.sbin.modprobe ] ++ (optional (cfg.storageDriver == "zfs") pkgs.zfs);
+        path = [ pkgs.kmod ] ++ (optional (cfg.storageDriver == "zfs") pkgs.zfs);
         environment.MODULE_DIR = "/run/current-system/kernel-modules/lib/modules";
 
         postStart = if cfg.socketActivation then "" else cfg.postStart;