Skip to content

Commit

Permalink
Revert "{activation-scripts,activate-system}: purify environment"
Browse files Browse the repository at this point in the history
This shouldn’t actually be split out from the Plan because of the
current use of `$HOME` in the defaults for channel‐based setups.

This reverts commit 4bff4bc.
  • Loading branch information
emilazy committed Jan 28, 2025
1 parent f43dac4 commit cc9c840
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
7 changes: 0 additions & 7 deletions modules/services/activate-system/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@
script = ''
set -e
set -o pipefail
export PATH="${pkgs.gnugrep}/bin:${pkgs.coreutils}/bin:@out@/sw/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export USER=root
export LOGNAME=root
export HOME=~root
export SHELL=$BASH
export LANG=C
export LC_CTYPE=UTF-8
systemConfig=$(cat ${config.system.profile}/systemConfig)
Expand Down
19 changes: 1 addition & 18 deletions modules/system/activation-scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,16 @@ in
config = {

system.activationScripts.script.text = ''
#!/usr/bin/env -i ${stdenv.shell}
# shellcheck shell=bash
# shellcheck disable=SC2096
#! ${stdenv.shell}
set -e
set -o pipefail
export PATH="${pkgs.gnugrep}/bin:${pkgs.coreutils}/bin:@out@/sw/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export USER=root
export LOGNAME=root
export HOME=~root
export SHELL=$BASH
export LANG=C
export LC_CTYPE=UTF-8
systemConfig=@out@
# Ensure a consistent umask.
umask 0022
cd /
if [[ $(id -u) -ne 0 ]]; then
printf >&2 '\e[1;31merror: `activate` must be run as root\e[0m\n'
exit 2
fi
${cfg.activationScripts.preActivation.text}
# We run `etcChecks` again just in case someone runs `activate`
Expand Down

0 comments on commit cc9c840

Please sign in to comment.