diff options
| author | Liam Hupfer <liam@hpfr.net> | 2025-02-05 22:24:58 -0600 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-02-21 15:27:10 +0100 |
| commit | 50a2d73eac1577e35b526d3fc91423b97e581aef (patch) | |
| tree | 403644afdf94f76aa8d04fe4a719183ab9c6beda /gnu | |
| parent | 890fe50d9b3b780f30e802cd2b4d9f8334151057 (diff) | |
home: services: Unset variables after profile init.
While they aren’t exported, these temporary variables show up in the
resulting shell, cluttering tab completion and declare -p.
* gnu/home/services.scm (environment-variables->setup-environment-script):
Unset shell variables.
* gnu/home/services/shells.scm (add-shell-profile-file): Likewise.
Change-Id: Ibb634849d9f38c1a9a44c0d493e92231364de958
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/home/services.scm | 6 | ||||
| -rw-r--r-- | gnu/home/services/shells.scm | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gnu/home/services.scm b/gnu/home/services.scm index aa7beeb462d..453336c959a 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm | |||
| @@ -275,7 +275,8 @@ exported." | |||
| 275 | (lambda (port) | 275 | (lambda (port) |
| 276 | (set-port-encoding! port "UTF-8") | 276 | (set-port-encoding! port "UTF-8") |
| 277 | (display "\ | 277 | (display "\ |
| 278 | HOME_ENVIRONMENT=$HOME/.guix-home | 278 | # NOTE: Set HOME_ENVIRONMENT before sourcing (home-shell-profile-service-type ensures |
| 279 | # ~/.profile does) | ||
| 279 | GUIX_PROFILE=\"$HOME_ENVIRONMENT/profile\" | 280 | GUIX_PROFILE=\"$HOME_ENVIRONMENT/profile\" |
| 280 | PROFILE_FILE=\"$GUIX_PROFILE/etc/profile\" | 281 | PROFILE_FILE=\"$GUIX_PROFILE/etc/profile\" |
| 281 | [ -f $PROFILE_FILE ] && . $PROFILE_FILE | 282 | [ -f $PROFILE_FILE ] && . $PROFILE_FILE |
| @@ -301,6 +302,9 @@ case $XCURSOR_PATH in | |||
| 301 | *) export XCURSOR_PATH=$GUIX_PROFILE/share/icons:$XCURSOR_PATH ;; | 302 | *) export XCURSOR_PATH=$GUIX_PROFILE/share/icons:$XCURSOR_PATH ;; |
| 302 | esac | 303 | esac |
| 303 | 304 | ||
| 305 | # Keep the shell environment clean. | ||
| 306 | unset GUIX_PROFILE PROFILE_FILE | ||
| 307 | |||
| 304 | " port) | 308 | " port) |
| 305 | (display | 309 | (display |
| 306 | #$(environment-variable-shell-definitions vars) | 310 | #$(environment-variable-shell-definitions vars) |
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm index ee6b09f17c3..bab5730c3d6 100644 --- a/gnu/home/services/shells.scm +++ b/gnu/home/services/shells.scm | |||
| @@ -89,7 +89,8 @@ really know what you do.")) | |||
| 89 | "\ | 89 | "\ |
| 90 | HOME_ENVIRONMENT=$HOME/.guix-home | 90 | HOME_ENVIRONMENT=$HOME/.guix-home |
| 91 | . $HOME_ENVIRONMENT/setup-environment | 91 | . $HOME_ENVIRONMENT/setup-environment |
| 92 | $HOME_ENVIRONMENT/on-first-login\n" | 92 | $HOME_ENVIRONMENT/on-first-login |
| 93 | unset HOME_ENVIRONMENT\n" | ||
| 93 | (serialize-configuration | 94 | (serialize-configuration |
| 94 | config | 95 | config |
| 95 | (filter-configuration-fields | 96 | (filter-configuration-fields |
