From bcf54ce5bbc8c325cfd2b6bcc5cec7661ef49183 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 15 Jan 2019 23:41:31 +0100 Subject: treewide: use ${stdenv.shell} instead of /bin/sh where possible --- pkgs/os-specific/linux/alsa-plugins/wrapper.nix | 2 +- pkgs/os-specific/linux/bbswitch/default.nix | 4 ++-- pkgs/os-specific/linux/ofp/default.nix | 2 +- pkgs/os-specific/linux/rfkill/rfkill-hook.sh | 2 +- pkgs/os-specific/linux/rfkill/udev.nix | 16 +++++++++++----- pkgs/os-specific/linux/service-wrapper/default.nix | 5 +++-- .../os-specific/linux/service-wrapper/service-wrapper.sh | 2 +- pkgs/os-specific/linux/tp_smapi/default.nix | 2 +- 8 files changed, 21 insertions(+), 14 deletions(-) (limited to 'pkgs/os-specific') diff --git a/pkgs/os-specific/linux/alsa-plugins/wrapper.nix b/pkgs/os-specific/linux/alsa-plugins/wrapper.nix index 60262a14c9b2..769b6ecd9bf2 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 f5d3b4f5c4e1..f5bc7458240a 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 3b2a22e452db..93cf33979f4b 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 bf6e679660c9..75716e40daee 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 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 +} diff --git a/pkgs/os-specific/linux/service-wrapper/default.nix b/pkgs/os-specific/linux/service-wrapper/default.nix index 64e38b41a5fa..6c9635b3aee4 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 373d86443f02..460bf678e6ac 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 89c6639748d0..6ad232e0b1dd 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" ]; -- cgit 1.4.1