nixos: Move uses of stdenv.shell to runtimeShell.

This commit is contained in:
Shea Levy 2018-03-01 14:38:53 -05:00
parent e70f61f5a1
commit fec543436d
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27
41 changed files with 57 additions and 57 deletions

View file

@ -93,7 +93,7 @@ in
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
RemainAfterExit = true; RemainAfterExit = true;
ExecStop = "${pkgs.stdenv.shell} -c 'echo 1 > /sys/class/block/${dev}/reset'"; ExecStop = "${pkgs.runtimeShell} -c 'echo 1 > /sys/class/block/${dev}/reset'";
}; };
script = '' script = ''
set -u set -u

View file

@ -75,10 +75,10 @@ in
# Create /dev/nvidia-uvm when the nvidia-uvm module is loaded. # Create /dev/nvidia-uvm when the nvidia-uvm module is loaded.
services.udev.extraRules = services.udev.extraRules =
'' ''
KERNEL=="nvidia", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidiactl c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) 255'" KERNEL=="nvidia", RUN+="${pkgs.runtimeShell} -c 'mknod -m 666 /dev/nvidiactl c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) 255'"
KERNEL=="nvidia_modeset", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidia-modeset c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) 254'" KERNEL=="nvidia_modeset", RUN+="${pkgs.runtimeShell} -c 'mknod -m 666 /dev/nvidia-modeset c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) 254'"
KERNEL=="card*", SUBSYSTEM=="drm", DRIVERS=="nvidia", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidia%n c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) %n'" KERNEL=="card*", SUBSYSTEM=="drm", DRIVERS=="nvidia", RUN+="${pkgs.runtimeShell} -c 'mknod -m 666 /dev/nvidia%n c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) %n'"
KERNEL=="nvidia_uvm", RUN+="${pkgs.stdenv.shell} -c 'mknod -m 666 /dev/nvidia-uvm c $(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 0'" KERNEL=="nvidia_uvm", RUN+="${pkgs.runtimeShell} -c 'mknod -m 666 /dev/nvidia-uvm c $(grep nvidia-uvm /proc/devices | cut -d \ -f 1) 0'"
''; '';
boot.blacklistedKernelModules = [ "nouveau" "nvidiafb" ]; boot.blacklistedKernelModules = [ "nouveau" "nvidiafb" ];

View file

@ -6,7 +6,7 @@ let
cfg = config.programs.rootston; cfg = config.programs.rootston;
rootstonWrapped = pkgs.writeScriptBin "rootston" '' rootstonWrapped = pkgs.writeScriptBin "rootston" ''
#! ${pkgs.stdenv.shell} #! ${pkgs.runtimeShell}
if [[ "$#" -ge 1 ]]; then if [[ "$#" -ge 1 ]]; then
exec ${pkgs.rootston}/bin/rootston "$@" exec ${pkgs.rootston}/bin/rootston "$@"
else else

View file

@ -13,7 +13,7 @@ let
askPasswordWrapper = pkgs.writeScript "ssh-askpass-wrapper" askPasswordWrapper = pkgs.writeScript "ssh-askpass-wrapper"
'' ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
export DISPLAY="$(systemctl --user show-environment | ${pkgs.gnused}/bin/sed 's/^DISPLAY=\(.*\)/\1/; t; d')" export DISPLAY="$(systemctl --user show-environment | ${pkgs.gnused}/bin/sed 's/^DISPLAY=\(.*\)/\1/; t; d')"
exec ${askPassword} exec ${askPassword}
''; '';

View file

@ -13,7 +13,7 @@ let
}; };
disableScript = pkgs.writeScript "audit-disable" '' disableScript = pkgs.writeScript "audit-disable" ''
#!${pkgs.stdenv.shell} -eu #!${pkgs.runtimeShell} -eu
# Explicitly disable everything, as otherwise journald might start it. # Explicitly disable everything, as otherwise journald might start it.
auditctl -D auditctl -D
auditctl -e 0 -a task,never auditctl -e 0 -a task,never
@ -23,7 +23,7 @@ let
# put in the store like this. At the same time, it doesn't feel like a huge deal and working # put in the store like this. At the same time, it doesn't feel like a huge deal and working
# around that is a pain so I'm leaving it like this for now. # around that is a pain so I'm leaving it like this for now.
startScript = pkgs.writeScript "audit-start" '' startScript = pkgs.writeScript "audit-start" ''
#!${pkgs.stdenv.shell} -eu #!${pkgs.runtimeShell} -eu
# Clear out any rules we may start with # Clear out any rules we may start with
auditctl -D auditctl -D
@ -43,7 +43,7 @@ let
''; '';
stopScript = pkgs.writeScript "audit-stop" '' stopScript = pkgs.writeScript "audit-stop" ''
#!${pkgs.stdenv.shell} -eu #!${pkgs.runtimeShell} -eu
# Clear the rules # Clear the rules
auditctl -D auditctl -D

View file

@ -18,7 +18,7 @@ let
hooksDir = let hooksDir = let
mkHookEntry = name: value: '' mkHookEntry = name: value: ''
cat > $out/${name} <<EOF cat > $out/${name} <<EOF
#! ${pkgs.stdenv.shell} #! ${pkgs.runtimeShell}
set -e set -e
${value} ${value}
EOF EOF

View file

@ -2,7 +2,7 @@
let let
cfg = config.services.fourStoreEndpoint; cfg = config.services.fourStoreEndpoint;
endpointUser = "fourstorehttp"; endpointUser = "fourstorehttp";
run = "${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${endpointUser} -c"; run = "${pkgs.su}/bin/su -s ${pkgs.runtimeShell} ${endpointUser} -c";
in in
with lib; with lib;
{ {

View file

@ -3,7 +3,7 @@ let
cfg = config.services.fourStore; cfg = config.services.fourStore;
stateDir = "/var/lib/4store"; stateDir = "/var/lib/4store";
fourStoreUser = "fourstore"; fourStoreUser = "fourstore";
run = "${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${fourStoreUser}"; run = "${pkgs.su}/bin/su -s ${pkgs.runtimeShell} ${fourStoreUser}";
in in
with lib; with lib;
{ {

View file

@ -7,7 +7,7 @@ let
cfg = config.services.emacs; cfg = config.services.emacs;
editorScript = pkgs.writeScriptBin "emacseditor" '' editorScript = pkgs.writeScriptBin "emacseditor" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
if [ -z "$1" ]; then if [ -z "$1" ]; then
exec ${cfg.package}/bin/emacsclient --create-frame --alternate-editor ${cfg.package}/bin/emacs exec ${cfg.package}/bin/emacsclient --create-frame --alternate-editor ${cfg.package}/bin/emacs
else else

View file

@ -57,7 +57,7 @@ in {
chown ${fahUser} ${stateDir} chown ${fahUser} ${stateDir}
cp -f ${pkgs.writeText "client.cfg" cfg.config} ${stateDir}/client.cfg cp -f ${pkgs.writeText "client.cfg" cfg.config} ${stateDir}/client.cfg
''; '';
script = "${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${fahUser} -c 'cd ${stateDir}; ${pkgs.foldingathome}/bin/fah6'"; script = "${pkgs.su}/bin/su -s ${pkgs.runtimeShell} ${fahUser} -c 'cd ${stateDir}; ${pkgs.foldingathome}/bin/fah6'";
}; };
services.foldingAtHome.config = '' services.foldingAtHome.config = ''

View file

@ -14,7 +14,7 @@ let
# ExecStart= command with '@' doesn't work because we start a shell (new # ExecStart= command with '@' doesn't work because we start a shell (new
# process) that creates a new argv[0].) # process) that creates a new argv[0].)
geoip-updater = pkgs.writeScriptBin "geoip-updater" '' geoip-updater = pkgs.writeScriptBin "geoip-updater" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
skipExisting=0 skipExisting=0
debug() debug()
{ {

View file

@ -17,7 +17,7 @@ let
gititSh = hsPkgs: extras: with pkgs; let gititSh = hsPkgs: extras: with pkgs; let
env = gititWithPkgs hsPkgs extras; env = gititWithPkgs hsPkgs extras;
in writeScript "gitit" '' in writeScript "gitit" ''
#!${stdenv.shell} #!${runtimeShell}
cd $HOME cd $HOME
export NIX_GHC="${env}/bin/ghc" export NIX_GHC="${env}/bin/ghc"
export NIX_GHCPKG="${env}/bin/ghc-pkg" export NIX_GHCPKG="${env}/bin/ghc-pkg"

View file

@ -55,7 +55,7 @@ in
serviceConfig = { serviceConfig = {
User = config.users.extraUsers.ihaskell.name; User = config.users.extraUsers.ihaskell.name;
Group = config.users.extraGroups.ihaskell.name; Group = config.users.extraGroups.ihaskell.name;
ExecStart = "${pkgs.stdenv.shell} -c \"cd $HOME;${ihaskell}/bin/ihaskell-notebook\""; ExecStart = "${pkgs.runtimeShell} -c \"cd $HOME;${ihaskell}/bin/ihaskell-notebook\"";
}; };
}; };
}; };

View file

@ -188,7 +188,7 @@ in {
description = "Mesos Slave"; description = "Mesos Slave";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network.target" ]; after = [ "network.target" ];
path = [ pkgs.stdenv.shellPackage ]; path = [ pkgs.runtimeShellPackage ];
serviceConfig = { serviceConfig = {
ExecStart = '' ExecStart = ''
${pkgs.mesos}/bin/mesos-slave \ ${pkgs.mesos}/bin/mesos-slave \

View file

@ -30,7 +30,7 @@ let
# /bin/sh in the sandbox as a bind-mount to bash. This means we # /bin/sh in the sandbox as a bind-mount to bash. This means we
# also need to include the entire closure of bash. Nix >= 2.0 # also need to include the entire closure of bash. Nix >= 2.0
# provides a /bin/sh by default. # provides a /bin/sh by default.
sh = pkgs.stdenv.shell; sh = pkgs.runtimeShell;
binshDeps = pkgs.writeReferencesToFile sh; binshDeps = pkgs.writeReferencesToFile sh;
in in
pkgs.runCommand "nix.conf" { extraOptions = cfg.extraOptions; inherit binshDeps; } '' pkgs.runCommand "nix.conf" { extraOptions = cfg.extraOptions; inherit binshDeps; } ''

View file

@ -43,7 +43,7 @@ let
helpScript = pkgs.writeScriptBin "nixos-help" helpScript = pkgs.writeScriptBin "nixos-help"
'' ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
browser="$BROWSER" browser="$BROWSER"
if [ -z "$browser" ]; then if [ -z "$browser" ]; then
browser="$(type -P xdg-open || true)" browser="$(type -P xdg-open || true)"

View file

@ -8,7 +8,7 @@ let
# in nixpkgs doesn't seem to work properly on NixOS, so let's just fake the two fields SSM # in nixpkgs doesn't seem to work properly on NixOS, so let's just fake the two fields SSM
# looks for. See https://github.com/aws/amazon-ssm-agent/issues/38 for upstream fix. # looks for. See https://github.com/aws/amazon-ssm-agent/issues/38 for upstream fix.
fake-lsb-release = pkgs.writeScriptBin "lsb_release" '' fake-lsb-release = pkgs.writeScriptBin "lsb_release" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
case "$1" in case "$1" in
-i) echo "nixos";; -i) echo "nixos";;

View file

@ -38,7 +38,7 @@ let
]; ];
shellCmdsForEventScript = eventname: commands: '' shellCmdsForEventScript = eventname: commands: ''
echo "#!${pkgs.stdenv.shell}" > "$out/${eventname}" echo "#!${pkgs.runtimeShell}" > "$out/${eventname}"
echo '${commands}' >> "$out/${eventname}" echo '${commands}' >> "$out/${eventname}"
chmod a+x "$out/${eventname}" chmod a+x "$out/${eventname}"
''; '';

View file

@ -14,7 +14,7 @@ let
nx = cfg.notifications.x11; nx = cfg.notifications.x11;
smartdNotify = pkgs.writeScript "smartd-notify.sh" '' smartdNotify = pkgs.writeScript "smartd-notify.sh" ''
#! ${pkgs.stdenv.shell} #! ${pkgs.runtimeShell}
${optionalString nm.enable '' ${optionalString nm.enable ''
{ {
${pkgs.coreutils}/bin/cat << EOF ${pkgs.coreutils}/bin/cat << EOF

View file

@ -11,7 +11,7 @@ let
home = cfg.homeDir; home = cfg.homeDir;
startupScript = class: configPath: pkgs.writeScript "xtreemfs-osd.sh" '' startupScript = class: configPath: pkgs.writeScript "xtreemfs-osd.sh" ''
#! ${pkgs.stdenv.shell} #! ${pkgs.runtimeShell}
JAVA_HOME="${pkgs.jdk}" JAVA_HOME="${pkgs.jdk}"
JAVADIR="${xtreemfs}/share/java" JAVADIR="${xtreemfs}/share/java"
JAVA_CALL="$JAVA_HOME/bin/java -ea -cp $JAVADIR/XtreemFS.jar:$JAVADIR/BabuDB.jar:$JAVADIR/Flease.jar:$JAVADIR/protobuf-java-2.5.0.jar:$JAVADIR/Foundation.jar:$JAVADIR/jdmkrt.jar:$JAVADIR/jdmktk.jar:$JAVADIR/commons-codec-1.3.jar" JAVA_CALL="$JAVA_HOME/bin/java -ea -cp $JAVADIR/XtreemFS.jar:$JAVADIR/BabuDB.jar:$JAVADIR/Flease.jar:$JAVADIR/protobuf-java-2.5.0.jar:$JAVADIR/Foundation.jar:$JAVADIR/jdmkrt.jar:$JAVADIR/jdmktk.jar:$JAVADIR/commons-codec-1.3.jar"

View file

@ -99,10 +99,10 @@ in
exit 1 exit 1
fi fi
${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${u} \ ${pkgs.su}/bin/su -s ${pkgs.runtimeShell} ${u} \
-c '${pkgs.yandex-disk}/bin/yandex-disk token -p ${cfg.password} ${cfg.username} ${dir}/token' -c '${pkgs.yandex-disk}/bin/yandex-disk token -p ${cfg.password} ${cfg.username} ${dir}/token'
${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${u} \ ${pkgs.su}/bin/su -s ${pkgs.runtimeShell} ${u} \
-c '${pkgs.yandex-disk}/bin/yandex-disk start --no-daemon -a ${dir}/token -d ${cfg.directory} --exclude-dirs=${cfg.excludes}' -c '${pkgs.yandex-disk}/bin/yandex-disk start --no-daemon -a ${dir}/token -d ${cfg.directory} --exclude-dirs=${cfg.excludes}'
''; '';

View file

@ -68,7 +68,7 @@ in
''; '';
script = '' script = ''
${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${user} \ ${pkgs.su}/bin/su -s ${pkgs.runtimeShell} ${user} \
-c 'HOME="${cfg.dataDir}" ${pkgs.amuleDaemon}/bin/amuled' -c 'HOME="${cfg.dataDir}" ${pkgs.amuleDaemon}/bin/amuled'
''; '';
}; };

View file

@ -54,7 +54,7 @@ let
''; '';
writeShScript = name: text: let dir = pkgs.writeScriptBin name '' writeShScript = name: text: let dir = pkgs.writeScriptBin name ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
${text} ${text}
''; in "${dir}/bin/${name}"; ''; in "${dir}/bin/${name}";

View file

@ -22,7 +22,7 @@ let
flashpolicydWrapper = pkgs.writeScriptBin "flashpolicyd" flashpolicydWrapper = pkgs.writeScriptBin "flashpolicyd"
'' ''
#! ${pkgs.stdenv.shell} #! ${pkgs.runtimeShell}
exec ${flashpolicyd}/Perl_xinetd/in.flashpolicyd.pl \ exec ${flashpolicyd}/Perl_xinetd/in.flashpolicyd.pl \
--file=${pkgs.writeText "flashpolixy.xml" cfg.policy} \ --file=${pkgs.writeText "flashpolixy.xml" cfg.policy} \
2> /dev/null 2> /dev/null

View file

@ -116,7 +116,7 @@ in
include "${cfg.rulesetFile}" include "${cfg.rulesetFile}"
''; '';
checkScript = pkgs.writeScript "nftables-check" '' checkScript = pkgs.writeScript "nftables-check" ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
if $(${pkgs.kmod}/bin/lsmod | grep -q ip_tables); then if $(${pkgs.kmod}/bin/lsmod | grep -q ip_tables); then
echo "Unload ip_tables before using nftables!" 1>&2 echo "Unload ip_tables before using nftables!" 1>&2
exit 1 exit 1

View file

@ -6,7 +6,7 @@
with lib; with lib;
let let
mergeHook = pkgs.writeScript "rdnssd-merge-hook" '' mergeHook = pkgs.writeScript "rdnssd-merge-hook" ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
${pkgs.openresolv}/bin/resolvconf -u ${pkgs.openresolv}/bin/resolvconf -u
''; '';
in in

View file

@ -7,7 +7,7 @@ let
torify = pkgs.writeTextFile { torify = pkgs.writeTextFile {
name = "tsocks"; name = "tsocks";
text = '' text = ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
TSOCKS_CONF_FILE=${pkgs.writeText "tsocks.conf" cfg.tsocks.config} LD_PRELOAD="${pkgs.tsocks}/lib/libtsocks.so $LD_PRELOAD" "$@" TSOCKS_CONF_FILE=${pkgs.writeText "tsocks.conf" cfg.tsocks.config} LD_PRELOAD="${pkgs.tsocks}/lib/libtsocks.so $LD_PRELOAD" "$@"
''; '';
executable = true; executable = true;

View file

@ -23,7 +23,7 @@ let
wrapTorsocks = name: server: pkgs.writeTextFile { wrapTorsocks = name: server: pkgs.writeTextFile {
name = name; name = name;
text = '' text = ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
TORSOCKS_CONF_FILE=${pkgs.writeText "torsocks.conf" (configFile server)} ${pkgs.torsocks}/bin/torsocks "$@" TORSOCKS_CONF_FILE=${pkgs.writeText "torsocks.conf" (configFile server)} ${pkgs.torsocks}/bin/torsocks "$@"
''; '';
executable = true; executable = true;

View file

@ -90,7 +90,7 @@ in
# 1) Only the "transmission" user and group have access to torrents. # 1) Only the "transmission" user and group have access to torrents.
# 2) Optionally update/force specific fields into the configuration file. # 2) Optionally update/force specific fields into the configuration file.
serviceConfig.ExecStartPre = '' serviceConfig.ExecStartPre = ''
${pkgs.stdenv.shell} -c "mkdir -p ${homeDir} ${settingsDir} ${fullSettings.download-dir} ${fullSettings.incomplete-dir} && chmod 770 ${homeDir} ${settingsDir} ${fullSettings.download-dir} ${fullSettings.incomplete-dir} && rm -f ${settingsDir}/settings.json && cp -f ${settingsFile} ${settingsDir}/settings.json" ${pkgs.runtimeShell} -c "mkdir -p ${homeDir} ${settingsDir} ${fullSettings.download-dir} ${fullSettings.incomplete-dir} && chmod 770 ${homeDir} ${settingsDir} ${fullSettings.download-dir} ${fullSettings.incomplete-dir} && rm -f ${settingsDir}/settings.json && cp -f ${settingsFile} ${settingsDir}/settings.json"
''; '';
serviceConfig.ExecStart = "${pkgs.transmission}/bin/transmission-daemon -f --port ${toString config.services.transmission.port}"; serviceConfig.ExecStart = "${pkgs.transmission}/bin/transmission-daemon -f --port ${toString config.services.transmission.port}";
serviceConfig.ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; serviceConfig.ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";

View file

@ -346,7 +346,7 @@ let
postgresql = serverInfo.fullConfig.services.postgresql.package; postgresql = serverInfo.fullConfig.services.postgresql.package;
setupDb = pkgs.writeScript "setup-owncloud-db" '' setupDb = pkgs.writeScript "setup-owncloud-db" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
PATH="${postgresql}/bin" PATH="${postgresql}/bin"
createuser --no-superuser --no-createdb --no-createrole "${config.dbUser}" || true createuser --no-superuser --no-createdb --no-createrole "${config.dbUser}" || true
createdb "${config.dbName}" -O "${config.dbUser}" || true createdb "${config.dbName}" -O "${config.dbUser}" || true

View file

@ -128,7 +128,7 @@ in
# Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes. # Set GTK_DATA_PREFIX so that GTK+ can find the Xfce themes.
export GTK_DATA_PREFIX=${config.system.path} export GTK_DATA_PREFIX=${config.system.path}
${pkgs.stdenv.shell} ${pkgs.xfce.xinitrc} & ${pkgs.runtimeShell} ${pkgs.xfce.xinitrc} &
waitPID=$! waitPID=$!
''; '';
}]; }];

View file

@ -14,7 +14,7 @@ let
default_xserver ${dmcfg.xserverBin} default_xserver ${dmcfg.xserverBin}
xserver_arguments ${toString dmcfg.xserverArgs} xserver_arguments ${toString dmcfg.xserverArgs}
sessiondir ${dmcfg.session.desktops} sessiondir ${dmcfg.session.desktops}
login_cmd exec ${pkgs.stdenv.shell} ${dmcfg.session.script} "%session" login_cmd exec ${pkgs.runtimeShell} ${dmcfg.session.script} "%session"
halt_cmd ${config.systemd.package}/sbin/shutdown -h now halt_cmd ${config.systemd.package}/sbin/shutdown -h now
reboot_cmd ${config.systemd.package}/sbin/shutdown -r now reboot_cmd ${config.systemd.package}/sbin/shutdown -r now
logfile /dev/stderr logfile /dev/stderr

View file

@ -61,7 +61,7 @@ in
apply = set: { apply = set: {
script = script =
'' ''
#! ${pkgs.stdenv.shell} #! ${pkgs.runtimeShell}
systemConfig=@out@ systemConfig=@out@

View file

@ -40,7 +40,7 @@ let
{ splashImage = f cfg.splashImage; { splashImage = f cfg.splashImage;
grub = f grub; grub = f grub;
grubTarget = f (grub.grubTarget or ""); grubTarget = f (grub.grubTarget or "");
shell = "${pkgs.stdenv.shell}"; shell = "${pkgs.runtimeShell}";
fullName = (builtins.parseDrvName realGrub.name).name; fullName = (builtins.parseDrvName realGrub.name).name;
fullVersion = (builtins.parseDrvName realGrub.name).version; fullVersion = (builtins.parseDrvName realGrub.name).version;
grubEfi = f grubEfi; grubEfi = f grubEfi;
@ -536,7 +536,7 @@ in
btrfsprogs = pkgs.btrfs-progs; btrfsprogs = pkgs.btrfs-progs;
}; };
in pkgs.writeScript "install-grub.sh" ('' in pkgs.writeScript "install-grub.sh" (''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
set -e set -e
export PERL5LIB=${makePerlPath (with pkgs.perlPackages; [ FileSlurp XMLLibXML XMLSAX ListCompare ])} export PERL5LIB=${makePerlPath (with pkgs.perlPackages; [ FileSlurp XMLLibXML XMLSAX ListCompare ])}
${optionalString cfg.enableCryptodisk "export GRUB_ENABLE_CRYPTODISK=y"} ${optionalString cfg.enableCryptodisk "export GRUB_ENABLE_CRYPTODISK=y"}

View file

@ -241,37 +241,37 @@ let
} }
(mkIf (config.preStart != "") (mkIf (config.preStart != "")
{ serviceConfig.ExecStartPre = makeJobScript "${name}-pre-start" '' { serviceConfig.ExecStartPre = makeJobScript "${name}-pre-start" ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
${config.preStart} ${config.preStart}
''; '';
}) })
(mkIf (config.script != "") (mkIf (config.script != "")
{ serviceConfig.ExecStart = makeJobScript "${name}-start" '' { serviceConfig.ExecStart = makeJobScript "${name}-start" ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
${config.script} ${config.script}
'' + " " + config.scriptArgs; '' + " " + config.scriptArgs;
}) })
(mkIf (config.postStart != "") (mkIf (config.postStart != "")
{ serviceConfig.ExecStartPost = makeJobScript "${name}-post-start" '' { serviceConfig.ExecStartPost = makeJobScript "${name}-post-start" ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
${config.postStart} ${config.postStart}
''; '';
}) })
(mkIf (config.reload != "") (mkIf (config.reload != "")
{ serviceConfig.ExecReload = makeJobScript "${name}-reload" '' { serviceConfig.ExecReload = makeJobScript "${name}-reload" ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
${config.reload} ${config.reload}
''; '';
}) })
(mkIf (config.preStop != "") (mkIf (config.preStop != "")
{ serviceConfig.ExecStop = makeJobScript "${name}-pre-stop" '' { serviceConfig.ExecStop = makeJobScript "${name}-pre-stop" ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
${config.preStop} ${config.preStop}
''; '';
}) })
(mkIf (config.postStop != "") (mkIf (config.postStop != "")
{ serviceConfig.ExecStopPost = makeJobScript "${name}-post-stop" '' { serviceConfig.ExecStopPost = makeJobScript "${name}-post-stop" ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
${config.postStop} ${config.postStop}
''; '';
}) })

View file

@ -26,7 +26,7 @@ let
executable = true; executable = true;
destination = "/bin/bridge-stp"; destination = "/bin/bridge-stp";
text = '' text = ''
#!${pkgs.stdenv.shell} -e #!${pkgs.runtimeShell} -e
export PATH="${pkgs.mstpd}/bin" export PATH="${pkgs.mstpd}/bin"
BRIDGES=(${concatStringsSep " " (attrNames rstpBridges)}) BRIDGES=(${concatStringsSep " " (attrNames rstpBridges)})
@ -64,7 +64,7 @@ let
# udev script that configures a physical wlan device and adds virtual interfaces # udev script that configures a physical wlan device and adds virtual interfaces
wlanDeviceUdevScript = device: interfaceList: pkgs.writeScript "wlan-${device}-udev-script" '' wlanDeviceUdevScript = device: interfaceList: pkgs.writeScript "wlan-${device}-udev-script" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
# Change the wireless phy device to a predictable name. # Change the wireless phy device to a predictable name.
if [ -e "/sys/class/net/${device}/phy80211/name" ]; then if [ -e "/sys/class/net/${device}/phy80211/name" ]; then
@ -1158,7 +1158,7 @@ in
# The script creates the required, new WLAN interfaces interfaces and configures the # The script creates the required, new WLAN interfaces interfaces and configures the
# existing, default interface. # existing, default interface.
curInterfaceScript = device: current: new: pkgs.writeScript "udev-run-script-wlan-interfaces-${device}.sh" '' curInterfaceScript = device: current: new: pkgs.writeScript "udev-run-script-wlan-interfaces-${device}.sh" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
# Change the wireless phy device to a predictable name. # Change the wireless phy device to a predictable name.
${pkgs.iw}/bin/iw phy `${pkgs.coreutils}/bin/cat /sys/class/net/$INTERFACE/phy80211/name` set name ${device} ${pkgs.iw}/bin/iw phy `${pkgs.coreutils}/bin/cat /sys/class/net/$INTERFACE/phy80211/name` set name ${device}
@ -1177,7 +1177,7 @@ in
# Udev script to execute for a new WLAN interface. The script configures the new WLAN interface. # Udev script to execute for a new WLAN interface. The script configures the new WLAN interface.
newInterfaceScript = device: new: pkgs.writeScript "udev-run-script-wlan-interfaces-${new._iName}.sh" '' newInterfaceScript = device: new: pkgs.writeScript "udev-run-script-wlan-interfaces-${new._iName}.sh" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
# Configure the new interface # Configure the new interface
${pkgs.iw}/bin/iw dev ${new._iName} set type ${new.type} ${pkgs.iw}/bin/iw dev ${new._iName} set type ${new.type}
${optionalString (new.type == "mesh" && new.meshID!=null) "${pkgs.iw}/bin/iw dev ${device} set meshid ${new.meshID}"} ${optionalString (new.type == "mesh" && new.meshID!=null) "${pkgs.iw}/bin/iw dev ${device} set meshid ${new.meshID}"}

View file

@ -2,7 +2,7 @@
let let
script = '' script = ''
#!${pkgs.stdenv.shell} -eu #!${pkgs.runtimeShell} -eu
echo "attempting to fetch configuration from EC2 user data..." echo "attempting to fetch configuration from EC2 user data..."

View file

@ -47,7 +47,7 @@ let
}; };
provisionedHook = pkgs.writeScript "provisioned-hook" '' provisionedHook = pkgs.writeScript "provisioned-hook" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
${config.systemd.package}/bin/systemctl start provisioned.target ${config.systemd.package}/bin/systemctl start provisioned.target
''; '';

View file

@ -33,7 +33,7 @@ let
in in
pkgs.writeScript "container-init" pkgs.writeScript "container-init"
'' ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
# Initialise the container side of the veth pair. # Initialise the container side of the veth pair.
if [ "$PRIVATE_NETWORK" = 1 ]; then if [ "$PRIVATE_NETWORK" = 1 ]; then
@ -223,7 +223,7 @@ let
serviceDirectives = cfg: { serviceDirectives = cfg: {
ExecReload = pkgs.writeScript "reload-container" ExecReload = pkgs.writeScript "reload-container"
'' ''
#! ${pkgs.stdenv.shell} -e #! ${pkgs.runtimeShell} -e
${pkgs.nixos-container}/bin/nixos-container run "$INSTANCE" -- \ ${pkgs.nixos-container}/bin/nixos-container run "$INSTANCE" -- \
bash --login -c "''${SYSTEM_PATH:-/nix/var/nix/profiles/system}/bin/switch-to-configuration test" bash --login -c "''${SYSTEM_PATH:-/nix/var/nix/profiles/system}/bin/switch-to-configuration test"
''; '';

View file

@ -169,7 +169,7 @@ in {
mkdir -p ${runDir}/ipsec/{etc/racoon,etc/init.d/,usr/sbin/} mkdir -p ${runDir}/ipsec/{etc/racoon,etc/init.d/,usr/sbin/}
ln -fs ${pkgs.ipsecTools}/bin/setkey ${runDir}/ipsec/usr/sbin/setkey ln -fs ${pkgs.ipsecTools}/bin/setkey ${runDir}/ipsec/usr/sbin/setkey
ln -fs ${pkgs.writeScript "racoon-restart" '' ln -fs ${pkgs.writeScript "racoon-restart" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
/var/run/current-system/sw/bin/systemctl $1 racoon /var/run/current-system/sw/bin/systemctl $1 racoon
''} ${runDir}/ipsec/etc/init.d/racoon ''} ${runDir}/ipsec/etc/init.d/racoon
''; '';

View file

@ -30,7 +30,7 @@ let
# Shell script to start the VM. # Shell script to start the VM.
startVM = startVM =
'' ''
#! ${pkgs.stdenv.shell} #! ${pkgs.runtimeShell}
NIX_DISK_IMAGE=$(readlink -f ''${NIX_DISK_IMAGE:-${config.virtualisation.diskImage}}) NIX_DISK_IMAGE=$(readlink -f ''${NIX_DISK_IMAGE:-${config.virtualisation.diskImage}})