treewide: use runtimeShell in nixos/

This is needed for cross-compilation.
This commit is contained in:
Jörg Thalheim 2020-04-07 07:25:48 +01:00
parent 5040cd56b0
commit cf3328e7e3
No known key found for this signature in database
GPG key ID: 003F2096411B5F92
10 changed files with 22 additions and 22 deletions

View file

@ -30,7 +30,7 @@ let
phpOptionsStr = toKeyValue phpOptions; phpOptionsStr = toKeyValue phpOptions;
occ = pkgs.writeScriptBin "nextcloud-occ" '' occ = pkgs.writeScriptBin "nextcloud-occ" ''
#! ${pkgs.stdenv.shell} #! ${pkgs.runtimeShell}
cd ${cfg.package} cd ${cfg.package}
sudo=exec sudo=exec
if [[ "$USER" != nextcloud ]]; then if [[ "$USER" != nextcloud ]]; then

View file

@ -8,7 +8,7 @@ import ./make-test-python.nix {
services.dovecot2.protocols = [ "imap" "pop3" ]; services.dovecot2.protocols = [ "imap" "pop3" ];
environment.systemPackages = let environment.systemPackages = let
sendTestMail = pkgs.writeScriptBin "send-testmail" '' sendTestMail = pkgs.writeScriptBin "send-testmail" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
exec sendmail -vt <<MAIL exec sendmail -vt <<MAIL
From: root@localhost From: root@localhost
To: alice@localhost To: alice@localhost
@ -19,7 +19,7 @@ import ./make-test-python.nix {
''; '';
sendTestMailViaDeliveryAgent = pkgs.writeScriptBin "send-lda" '' sendTestMailViaDeliveryAgent = pkgs.writeScriptBin "send-lda" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
exec ${pkgs.dovecot}/libexec/dovecot/deliver -d bob <<MAIL exec ${pkgs.dovecot}/libexec/dovecot/deliver -d bob <<MAIL
From: root@localhost From: root@localhost

View file

@ -32,7 +32,7 @@ in {
testScript = let testScript = let
withRcloneEnv = pkgs.writeScript "with-rclone-env" '' withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/" export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/"
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud" export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
@ -41,12 +41,12 @@ in {
"''${@}" "''${@}"
''; '';
copySharedFile = pkgs.writeScript "copy-shared-file" '' copySharedFile = pkgs.writeScript "copy-shared-file" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
echo 'hi' | ${withRcloneEnv} ${pkgs.rclone}/bin/rclone rcat nextcloud:test-shared-file echo 'hi' | ${withRcloneEnv} ${pkgs.rclone}/bin/rclone rcat nextcloud:test-shared-file
''; '';
diffSharedFile = pkgs.writeScript "diff-shared-file" '' diffSharedFile = pkgs.writeScript "diff-shared-file" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file) diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file)
''; '';
in '' in ''

View file

@ -61,14 +61,14 @@ in {
testScript = let testScript = let
configureMemcached = pkgs.writeScript "configure-memcached" '' configureMemcached = pkgs.writeScript "configure-memcached" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
nextcloud-occ config:system:set memcached_servers 0 0 --value 127.0.0.1 --type string nextcloud-occ config:system:set memcached_servers 0 0 --value 127.0.0.1 --type string
nextcloud-occ config:system:set memcached_servers 0 1 --value 11211 --type integer nextcloud-occ config:system:set memcached_servers 0 1 --value 11211 --type integer
nextcloud-occ config:system:set memcache.local --value '\OC\Memcache\APCu' --type string nextcloud-occ config:system:set memcache.local --value '\OC\Memcache\APCu' --type string
nextcloud-occ config:system:set memcache.distributed --value '\OC\Memcache\Memcached' --type string nextcloud-occ config:system:set memcache.distributed --value '\OC\Memcache\Memcached' --type string
''; '';
withRcloneEnv = pkgs.writeScript "with-rclone-env" '' withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/" export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/"
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud" export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
@ -76,12 +76,12 @@ in {
export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})" export RCLONE_CONFIG_NEXTCLOUD_PASS="$(${pkgs.rclone}/bin/rclone obscure ${adminpass})"
''; '';
copySharedFile = pkgs.writeScript "copy-shared-file" '' copySharedFile = pkgs.writeScript "copy-shared-file" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
echo 'hi' | ${pkgs.rclone}/bin/rclone rcat nextcloud:test-shared-file echo 'hi' | ${pkgs.rclone}/bin/rclone rcat nextcloud:test-shared-file
''; '';
diffSharedFile = pkgs.writeScript "diff-shared-file" '' diffSharedFile = pkgs.writeScript "diff-shared-file" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file) diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file)
''; '';
in '' in ''

View file

@ -60,14 +60,14 @@ in {
testScript = let testScript = let
configureRedis = pkgs.writeScript "configure-redis" '' configureRedis = pkgs.writeScript "configure-redis" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
nextcloud-occ config:system:set redis 'host' --value 'localhost' --type string nextcloud-occ config:system:set redis 'host' --value 'localhost' --type string
nextcloud-occ config:system:set redis 'port' --value 6379 --type integer nextcloud-occ config:system:set redis 'port' --value 6379 --type integer
nextcloud-occ config:system:set memcache.local --value '\OC\Memcache\Redis' --type string nextcloud-occ config:system:set memcache.local --value '\OC\Memcache\Redis' --type string
nextcloud-occ config:system:set memcache.locking --value '\OC\Memcache\Redis' --type string nextcloud-occ config:system:set memcache.locking --value '\OC\Memcache\Redis' --type string
''; '';
withRcloneEnv = pkgs.writeScript "with-rclone-env" '' withRcloneEnv = pkgs.writeScript "with-rclone-env" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav export RCLONE_CONFIG_NEXTCLOUD_TYPE=webdav
export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/" export RCLONE_CONFIG_NEXTCLOUD_URL="http://nextcloud/remote.php/webdav/"
export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud" export RCLONE_CONFIG_NEXTCLOUD_VENDOR="nextcloud"
@ -76,12 +76,12 @@ in {
"''${@}" "''${@}"
''; '';
copySharedFile = pkgs.writeScript "copy-shared-file" '' copySharedFile = pkgs.writeScript "copy-shared-file" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
echo 'hi' | ${pkgs.rclone}/bin/rclone rcat nextcloud:test-shared-file echo 'hi' | ${pkgs.rclone}/bin/rclone rcat nextcloud:test-shared-file
''; '';
diffSharedFile = pkgs.writeScript "diff-shared-file" '' diffSharedFile = pkgs.writeScript "diff-shared-file" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file) diff <(echo 'hi') <(${pkgs.rclone}/bin/rclone cat nextcloud:test-shared-file)
''; '';
in '' in ''

View file

@ -15,7 +15,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
machine.wait_for_unit("rabbitmq.service") machine.wait_for_unit("rabbitmq.service")
machine.wait_until_succeeds( machine.wait_until_succeeds(
'su -s ${pkgs.stdenv.shell} rabbitmq -c "rabbitmqctl status"' 'su -s ${pkgs.runtimeShell} rabbitmq -c "rabbitmqctl status"'
) )
''; '';
}) })

View file

@ -22,7 +22,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
# Ensures failures pass through using pipefail, otherwise failing to # Ensures failures pass through using pipefail, otherwise failing to
# switch-to-configuration is hidden by the success of `tee`. # switch-to-configuration is hidden by the success of `tee`.
stderrRunner = pkgs.writeScript "stderr-runner" '' stderrRunner = pkgs.writeScript "stderr-runner" ''
#! ${pkgs.stdenv.shell} #! ${pkgs.runtimeShell}
set -e set -e
set -o pipefail set -o pipefail
exec env -i "$@" | tee /dev/stderr exec env -i "$@" | tee /dev/stderr

View file

@ -3,14 +3,14 @@ import ./make-test.nix {
machine = { pkgs, lib, ... }: let machine = { pkgs, lib, ... }: let
testServer = pkgs.writeScript "testserver.sh" '' testServer = pkgs.writeScript "testserver.sh" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
export PATH=${lib.escapeShellArg "${pkgs.coreutils}/bin"} export PATH=${lib.escapeShellArg "${pkgs.coreutils}/bin"}
${lib.escapeShellArg pkgs.stdenv.shell} 2>&1 ${lib.escapeShellArg pkgs.runtimeShell} 2>&1
echo "exit-status:$?" echo "exit-status:$?"
''; '';
testClient = pkgs.writeScriptBin "chroot-exec" '' testClient = pkgs.writeScriptBin "chroot-exec" ''
#!${pkgs.stdenv.shell} -e #!${pkgs.runtimeShell} -e
output="$(echo "$@" | nc -NU "/run/test$(< /teststep).sock")" output="$(echo "$@" | nc -NU "/run/test$(< /teststep).sock")"
ret="$(echo "$output" | sed -nre '$s/^exit-status:([0-9]+)$/\1/p')" ret="$(echo "$output" | sed -nre '$s/^exit-status:([0-9]+)$/\1/p')"
echo "$output" | head -n -1 echo "$output" | head -n -1

View file

@ -22,7 +22,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
test-support.displayManager.auto.user = "alice"; test-support.displayManager.auto.user = "alice";
systemd.shutdown.test = pkgs.writeScript "test.shutdown" '' systemd.shutdown.test = pkgs.writeScript "test.shutdown" ''
#!${pkgs.stdenv.shell} #!${pkgs.runtimeShell}
PATH=${lib.makeBinPath (with pkgs; [ utillinux coreutils ])} PATH=${lib.makeBinPath (with pkgs; [ utillinux coreutils ])}
mount -t 9p shared -o trans=virtio,version=9p2000.L /tmp/shared mount -t 9p shared -o trans=virtio,version=9p2000.L /tmp/shared
touch /tmp/shared/shutdown-test touch /tmp/shared/shutdown-test

View file

@ -23,7 +23,7 @@ let
guestAdditions = pkgs.linuxPackages.virtualboxGuestAdditions; guestAdditions = pkgs.linuxPackages.virtualboxGuestAdditions;
miniInit = '' miniInit = ''
#!${pkgs.stdenv.shell} -xe #!${pkgs.runtimeShell} -xe
export PATH="${lib.makeBinPath [ pkgs.coreutils pkgs.utillinux ]}" export PATH="${lib.makeBinPath [ pkgs.coreutils pkgs.utillinux ]}"
mkdir -p /run/dbus mkdir -p /run/dbus
@ -80,7 +80,7 @@ let
touch /mnt-root/boot-done touch /mnt-root/boot-done
hostname "${vmName}" hostname "${vmName}"
mkdir -p /nix/store mkdir -p /nix/store
unshare -m ${escapeShellArg pkgs.stdenv.shell} -c ' unshare -m ${escapeShellArg pkgs.runtimeShell} -c '
mount -t vboxsf nixstore /nix/store mount -t vboxsf nixstore /nix/store
exec "$stage2Init" exec "$stage2Init"
' '