diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2018-01-13 19:44:26 +0100 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2018-01-13 19:45:57 +0100 |
| commit | f6b9e43a84a442013201d3b197659fb7672a1b7f (patch) | |
| tree | 2b61b3d088d69d75643db1158de8da21c4c7f4ea /modules/system | |
| parent | 8bffb9877e49d34d41c6220f83526184a915de63 (diff) | |
checks: add /etc/profile check from bootstrap script
Diffstat (limited to 'modules/system')
| -rw-r--r-- | modules/system/activation-checks.nix | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/system/activation-checks.nix b/modules/system/activation-checks.nix index bddaa47..0379e0b 100644 --- a/modules/system/activation-checks.nix +++ b/modules/system/activation-checks.nix @@ -53,6 +53,22 @@ let esac ''; + nixInstaller = '' + if grep -q 'etc/profile.d/nix-daemon.sh' /etc/profile; then + echo "[1;31merror: Found nix-daemon.sh reference in /etc/profile, aborting activation[0m" >&2 + echo "This will override options like nix.nixPath because it runs later," >&2 + echo "remove this snippet from /etc/profile:" >&2 + echo >&2 + echo " # Nix" >&2 + echo " if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then" >&2 + echo " . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'" >&2 + echo " fi" >&2 + echo " # End Nix" >&2 + echo >&2 + exit 2 + fi + ''; + nixPath = '' darwinConfig=$(NIX_PATH=${concatStringsSep ":" config.nix.nixPath} nix-instantiate --eval -E '<darwin-config>' || echo '$HOME/.nixpkgs/darwin-configuration.nix') || true if ! test -e "$darwinConfig"; then @@ -104,6 +120,7 @@ in ${darwinChanges} ${buildUsers} ${nixChannels} + ${nixInstaller} ${nixPath} if test ''${checkActivation:-0} -eq 1; then |
