about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/rfkill/udev.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/rfkill/udev.nix')
-rw-r--r--pkgs/os-specific/linux/rfkill/udev.nix16
1 files changed, 11 insertions, 5 deletions
diff --git a/pkgs/os-specific/linux/rfkill/udev.nix b/pkgs/os-specific/linux/rfkill/udev.nix
index 054ed471eaaf..de23071f0260 100644
--- a/pkgs/os-specific/linux/rfkill/udev.nix
+++ b/pkgs/os-specific/linux/rfkill/udev.nix
@@ -1,4 +1,4 @@
-{ stdenv }:
+{ stdenv, substituteAll }:
 
 # Provides a facility to hook into rfkill changes.
 #
@@ -10,7 +10,7 @@
 # Add a hook script in the managed etc directory, e.g.:
 #   etc = [
 #     { source = pkgs.writeScript "rtfkill.hook" ''
-#         #!/bin/sh
+#         #!${stdenv.shell}
 #
 #         if [ "$RFKILL_STATE" -eq "1" ]; then
 #           exec ${config.system.build.upstart}/sbin/initctl emit -n antenna-on
@@ -24,7 +24,13 @@
 # Note: this package does not need the binaries
 # in the rfkill package.
 
-stdenv.mkDerivation {
+let
+  rfkillHook =
+    substituteAll {
+    inherit (stdenv) shell;
+    src = ./rfkill-hook.sh;
+  };
+in stdenv.mkDerivation {
   name = "rfkill-udev";
 
   unpackPhase = "true";
@@ -37,7 +43,7 @@ stdenv.mkDerivation {
     EOF
 
     mkdir -p "$out/bin/";
-    cp ${./rfkill-hook.sh} "$out/bin/rfkill-hook.sh"
+    cp ${rfkillHook} "$out/bin/rfkill-hook.sh"
     chmod +x "$out/bin/rfkill-hook.sh";
   '';
 
@@ -46,4 +52,4 @@ stdenv.mkDerivation {
     description = "Rules+hook for udev to catch rfkill state changes";
     platforms = stdenv.lib.platforms.linux;
   };
-}
\ No newline at end of file
+}