From cc9c8408bb9f29b4afe919eff4ad922d054cf591 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 28 Jan 2025 02:31:20 +0000 Subject: [PATCH] Revert "{activation-scripts,activate-system}: purify environment" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 4bff4bc8ae105dbc3a56ed5255fbde9495cbf4c1. --- modules/services/activate-system/default.nix | 7 ------- modules/system/activation-scripts.nix | 19 +------------------ 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/modules/services/activate-system/default.nix b/modules/services/activate-system/default.nix index 127514a6c..d8d868313 100644 --- a/modules/services/activate-system/default.nix +++ b/modules/services/activate-system/default.nix @@ -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) diff --git a/modules/system/activation-scripts.nix b/modules/system/activation-scripts.nix index 0143d2baf..b95ea3240 100644 --- a/modules/system/activation-scripts.nix +++ b/modules/system/activation-scripts.nix @@ -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`