Skip to content

Commit

Permalink
Merge pull request #11346 from mjgallag/nix-profile-daemon-set-u
Browse files Browse the repository at this point in the history
nix-daemon.sh profile script: operate under `set -u` in bash
  • Loading branch information
tomberek committed Aug 26, 2024
2 parents 440de80 + 2f0db04 commit 3b6e24f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/nix-profile-daemon.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ elif [ -e /etc/pki/tls/certs/ca-bundle.crt ]; then # Fedora, CentOS
else
# Fall back to what is in the nix profiles, favouring whatever is defined last.
check_nix_profiles() {
if [ -n "$ZSH_VERSION" ]; then
if [ -n "${ZSH_VERSION:-}" ]; then
# Zsh by default doesn't split words in unquoted parameter expansion.
# Set local_options for these options to be reverted at the end of the function
# and shwordsplit to force splitting words in $NIX_PROFILES below.
Expand Down
6 changes: 6 additions & 0 deletions tests/installer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,16 @@ let
$ssh <<EOF
set -ex
# enable nounset while loading the profile
# this may or may not work on all distros, depending on the quality of their scripts
set -u
# FIXME: get rid of this; ideally ssh should just work.
source ~/.bash_profile || true
source ~/.bash_login || true
source ~/.profile || true
set +u
source /etc/bashrc || true
nix-env --version
Expand Down

0 comments on commit 3b6e24f

Please sign in to comment.