summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2019-01-15 23:41:31 +0100
committerrnhmjoj <rnhmjoj@inventati.org>2019-01-16 20:37:15 +0100
commitbcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183 (patch)
tree26aef5b71509a26f7986e6cf9928b7687c21787d /pkgs/os-specific
parent3956a8421f2d78bc66ad9d3c23a3b5510bc695be (diff)
downloadnixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar
nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.gz
nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.bz2
nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.lz
nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.xz
nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.tar.zst
nixpkgs-bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183.zip
treewide: use ${stdenv.shell} instead of /bin/sh where possible
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/alsa-plugins/wrapper.nix2
-rw-r--r--pkgs/os-specific/linux/bbswitch/default.nix4
-rw-r--r--pkgs/os-specific/linux/ofp/default.nix2
-rwxr-xr-xpkgs/os-specific/linux/rfkill/rfkill-hook.sh2
-rw-r--r--pkgs/os-specific/linux/rfkill/udev.nix16
-rw-r--r--pkgs/os-specific/linux/service-wrapper/default.nix5
-rwxr-xr-xpkgs/os-specific/linux/service-wrapper/service-wrapper.sh2
-rw-r--r--pkgs/os-specific/linux/tp_smapi/default.nix2
8 files changed, 21 insertions, 14 deletions
diff --git a/pkgs/os-specific/linux/alsa-plugins/wrapper.nix b/pkgs/os-specific/linux/alsa-plugins/wrapper.nix
index 60262a14c9b..769b6ecd9bf 100644
--- a/pkgs/os-specific/linux/alsa-plugins/wrapper.nix
+++ b/pkgs/os-specific/linux/alsa-plugins/wrapper.nix
@@ -1,5 +1,5 @@
 { writeScriptBin, stdenv, alsaPlugins }:
 writeScriptBin "ap${if stdenv.hostPlatform.system == "i686-linux" then "32" else "64"}" ''
-  #/bin/sh
+  #${stdenv.shell}
   ALSA_PLUGIN_DIRS=${alsaPlugins}/lib/alsa-lib "$@"
 ''
diff --git a/pkgs/os-specific/linux/bbswitch/default.nix b/pkgs/os-specific/linux/bbswitch/default.nix
index f5d3b4f5c4e..f5bc7458240 100644
--- a/pkgs/os-specific/linux/bbswitch/default.nix
+++ b/pkgs/os-specific/linux/bbswitch/default.nix
@@ -36,12 +36,12 @@ stdenv.mkDerivation {
 
     mkdir -p $out/bin
     tee $out/bin/discrete_vga_poweroff << EOF
-    #!/bin/sh
+    #!${stdenv.shell}
 
     echo -n OFF > /proc/acpi/bbswitch
     EOF
     tee $out/bin/discrete_vga_poweron << EOF
-    #!/bin/sh
+    #!${stdenv.shell}
 
     echo -n ON > /proc/acpi/bbswitch
     EOF
diff --git a/pkgs/os-specific/linux/ofp/default.nix b/pkgs/os-specific/linux/ofp/default.nix
index 3b2a22e452d..93cf33979f4 100644
--- a/pkgs/os-specific/linux/ofp/default.nix
+++ b/pkgs/os-specific/linux/ofp/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   postPatch = ''
     substituteInPlace configure.ac --replace m4_esyscmd m4_esyscmd_s
-    substituteInPlace scripts/git_hash.sh --replace /bin/bash /bin/sh
+    substituteInPlace scripts/git_hash.sh --replace /bin/bash ${stdenv.shell}
     echo ${version} > .scmversion
   '';
 
diff --git a/pkgs/os-specific/linux/rfkill/rfkill-hook.sh b/pkgs/os-specific/linux/rfkill/rfkill-hook.sh
index bf6e679660c..75716e40dae 100755
--- a/pkgs/os-specific/linux/rfkill/rfkill-hook.sh
+++ b/pkgs/os-specific/linux/rfkill/rfkill-hook.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@shell@
 
 # Executes a hook in case of a change to the
 # rfkill state. The hook can be passed as
diff --git a/pkgs/os-specific/linux/rfkill/udev.nix b/pkgs/os-specific/linux/rfkill/udev.nix
index 054ed471eaa..de23071f026 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
+}
diff --git a/pkgs/os-specific/linux/service-wrapper/default.nix b/pkgs/os-specific/linux/service-wrapper/default.nix
index 64e38b41a5f..6c9635b3aee 100644
--- a/pkgs/os-specific/linux/service-wrapper/default.nix
+++ b/pkgs/os-specific/linux/service-wrapper/default.nix
@@ -1,4 +1,4 @@
-{ lib, runCommand, substituteAll, coreutils }:
+{ stdenv, runCommand, substituteAll, coreutils }:
 
 let
   name = "service-wrapper-${version}";
@@ -7,10 +7,11 @@ in
 runCommand "${name}" {
   script = substituteAll {
     src = ./service-wrapper.sh;
+    inherit (stdenv) shell;
     inherit coreutils;
   };
 
-  meta = with lib; {
+  meta = with stdenv.lib; {
     description = "A convenient wrapper for the systemctl commands, borrow from Ubuntu";
     license     = licenses.gpl2Plus;
     platforms   = platforms.linux;
diff --git a/pkgs/os-specific/linux/service-wrapper/service-wrapper.sh b/pkgs/os-specific/linux/service-wrapper/service-wrapper.sh
index 373d86443f0..460bf678e6a 100755
--- a/pkgs/os-specific/linux/service-wrapper/service-wrapper.sh
+++ b/pkgs/os-specific/linux/service-wrapper/service-wrapper.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!@shell@
 
 ###########################################################################
 # /usr/bin/service
diff --git a/pkgs/os-specific/linux/tp_smapi/default.nix b/pkgs/os-specific/linux/tp_smapi/default.nix
index 89c6639748d..6ad232e0b1d 100644
--- a/pkgs/os-specific/linux/tp_smapi/default.nix
+++ b/pkgs/os-specific/linux/tp_smapi/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [
     "KBASE=${kernel.dev}/lib/modules/${kernel.modDirVersion}"
-    "SHELL=/bin/sh"
+    "SHELL=${stdenv.shell}"
     "HDAPS=1"
   ];