mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 08:12:29 +00:00
Merge pull request #11346 from mjgallag/nix-profile-daemon-set-u
nix-daemon.sh profile script: operate under `set -u` in bash
This commit is contained in:
commit
3b6e24f66c
@ -52,7 +52,7 @@ elif [ -e /etc/pki/tls/certs/ca-bundle.crt ]; then # Fedora, CentOS
|
|||||||
else
|
else
|
||||||
# Fall back to what is in the nix profiles, favouring whatever is defined last.
|
# Fall back to what is in the nix profiles, favouring whatever is defined last.
|
||||||
check_nix_profiles() {
|
check_nix_profiles() {
|
||||||
if [ -n "$ZSH_VERSION" ]; then
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
||||||
# Zsh by default doesn't split words in unquoted parameter expansion.
|
# 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
|
# 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.
|
# and shwordsplit to force splitting words in $NIX_PROFILES below.
|
||||||
|
@ -217,10 +217,16 @@ let
|
|||||||
$ssh <<EOF
|
$ssh <<EOF
|
||||||
set -ex
|
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.
|
# FIXME: get rid of this; ideally ssh should just work.
|
||||||
source ~/.bash_profile || true
|
source ~/.bash_profile || true
|
||||||
source ~/.bash_login || true
|
source ~/.bash_login || true
|
||||||
source ~/.profile || true
|
source ~/.profile || true
|
||||||
|
set +u
|
||||||
|
|
||||||
source /etc/bashrc || true
|
source /etc/bashrc || true
|
||||||
|
|
||||||
nix-env --version
|
nix-env --version
|
||||||
|
Loading…
Reference in New Issue
Block a user