aboutsummaryrefslogtreecommitdiff
path: root/etc/guix-install.sh
diff options
context:
space:
mode:
authorJakub Kądziołka <kuba@kadziolka.net>2021-01-01 18:26:51 +0100
committerJakub Kądziołka <kuba@kadziolka.net>2021-01-03 17:01:26 +0100
commit9d34b04f40aa510ba910a15a64ab8d8c8d1b6fd3 (patch)
tree13506d3e43698c8f58e1aa046cc06afe872d755f /etc/guix-install.sh
parent2cb5ebf7a89b59e3e220b837202e4469e1db38c7 (diff)
downloadguix-9d34b04f40aa510ba910a15a64ab8d8c8d1b6fd3.tar
guix-9d34b04f40aa510ba910a15a64ab8d8c8d1b6fd3.tar.gz
/etc/profile.d/guix.sh: Add guix pull profile even when absent
* etc/guix-install.sh (sys_create_init_profile): Set PATH and INFOPATH even when $_GUIX_PROFILE does not exist. After initial installation on a foreign distro, the guix pull profile won't be present in path. This means that the first guix pull won't take effect until the shell is restarted. ~/.guix-profile cannot be pre-loaded like this as the relevant paths are stored in ~/.guix-profile/etc/profile, which simply won't exist. However, guix package will output a relevant hint that instructs the user to reload the profile, so this isn't a problem.
Diffstat (limited to 'etc/guix-install.sh')
-rwxr-xr-xetc/guix-install.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index 9015f40bb6..94c04aa646 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -7,6 +7,7 @@
# Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
# Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
# Copyright © 2020 Daniel Brooks <db48x@db48x.net>
+# Copyright © 2021 Jakub Kądziołka <kuba@kadziolka.net>
#
# This file is part of GNU Guix.
#
@@ -454,14 +455,12 @@ sys_create_init_profile()
cat <<"EOF" > /etc/profile.d/guix.sh
# _GUIX_PROFILE: `guix pull` profile
_GUIX_PROFILE="$HOME/.config/guix/current"
-if [ -L $_GUIX_PROFILE ]; then
- export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
- # Export INFOPATH so that the updated info pages can be found
- # and read by both /usr/bin/info and/or $GUIX_PROFILE/bin/info
- # When INFOPATH is unset, add a trailing colon so that Emacs
- # searches 'Info-default-directory-list'.
- export INFOPATH="$_GUIX_PROFILE/share/info:$INFOPATH"
-fi
+export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
+# Export INFOPATH so that the updated info pages can be found
+# and read by both /usr/bin/info and/or $GUIX_PROFILE/bin/info
+# When INFOPATH is unset, add a trailing colon so that Emacs
+# searches 'Info-default-directory-list'.
+export INFOPATH="$_GUIX_PROFILE/share/info:$INFOPATH"
# GUIX_PROFILE: User's default profile
GUIX_PROFILE="$HOME/.guix-profile"