X-Git-Url: http://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/3c69701f9735dd62a2f765b8bd23a7eaeb391412..2be5c2652a5fd79089048905ff6be60d74244d7b:/etc/guix-install.sh diff --git a/etc/guix-install.sh b/etc/guix-install.sh index d7fde7aacd..aa77d42615 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -3,7 +3,7 @@ # Copyright © 2017 sharlatan # Copyright © 2018 Ricardo Wurmus # Copyright © 2018 Efraim Flashner -# Copyright © 2019 Tobias Geerinckx-Rice +# Copyright © 2019, 2020 Tobias Geerinckx-Rice # # This file is part of GNU Guix. # @@ -48,6 +48,7 @@ REQUIRE=( "groupadd" "tail" "tr" + "xz" ) PAS=$'[ \033[32;1mPASS\033[0m ] ' @@ -110,7 +111,7 @@ chk_gpg_keyring() # systems where gpg has never been used, causing errors and confusion. gpg --dry-run --list-keys ${OPENPGP_SIGNING_KEY_ID} >/dev/null 2>&1 || ( _err "${ERR}Missing OpenPGP public key. Fetch it with this command:" - echo " wget https://sv.gnu.org/people/viewgpg.php?user_id=15145 -qO - | gpg --import -" + echo " wget 'https://sv.gnu.org/people/viewgpg.php?user_id=15145' -qO - | sudo -i gpg --import -" exit 1 ) } @@ -141,7 +142,7 @@ chk_init_sys() _msg "${INF}init system is: upstart" INIT_SYS="upstart" return 0 - elif [[ $(systemctl) =~ -\.mount ]]; then + elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then _msg "${INF}init system is: systemd" INIT_SYS="systemd" return 0 @@ -342,7 +343,18 @@ sys_enable_guix_daemon() _msg "${PAS}enabled Guix daemon via upstart" ;; systemd) - { cp "${ROOT_HOME}/.config/guix/current/lib/systemd/system/guix-daemon.service" \ + { # systemd .mount units must be named after the target directory. + # Here we assume a hard-coded name of /gnu/store. + # XXX Work around until next release. + if [ -f "${ROOT_HOME}/.config/guix/current/lib/systemd/system/gnu-store.mount" ]; then + cp "${ROOT_HOME}/.config/guix/current/lib/systemd/system/gnu-store.mount" \ + /etc/systemd/system/; + chmod 664 /etc/systemd/system/gnu-store.mount; + systemctl daemon-reload && + systemctl enable gnu-store.mount; + fi + + cp "${ROOT_HOME}/.config/guix/current/lib/systemd/system/guix-daemon.service" \ /etc/systemd/system/; chmod 664 /etc/systemd/system/guix-daemon.service; @@ -357,8 +369,8 @@ sys_enable_guix_daemon() fi; systemctl daemon-reload && - systemctl start guix-daemon && - systemctl enable guix-daemon; } && + systemctl enable guix-daemon && + systemctl start guix-daemon; } && _msg "${PAS}enabled Guix daemon via systemd" ;; sysv-init) @@ -406,6 +418,7 @@ sys_authorize_build_farms() sys_create_init_profile() { # Create /etc/profile.d/guix.sh for better desktop integration + # This will not take effect until the next shell or desktop session! [ -d "/etc/profile.d" ] || mkdir /etc/profile.d # Just in case cat <<"EOF" > /etc/profile.d/guix.sh # _GUIX_PROFILE: `guix pull` profile @@ -425,7 +438,7 @@ GUIX_PROFILE="$HOME/.guix-profile" GUIX_LOCPATH="$GUIX_PROFILE/lib/locale" export GUIX_PROFILE GUIX_LOCPATH -eval `guix package --search-paths=prefix 2> /dev/null` +[ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile" # set XDG_DATA_DIRS to include Guix installations export XDG_DATA_DIRS="$GUIX_PROFILE/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}" @@ -495,6 +508,9 @@ main() _msg "${PAS}Guix has successfully been installed!" _msg "${INF}Run 'info guix' to read the manual." + + # Required to source /etc/profile in desktop environments. + _msg "${INF}Please log out and back in to complete the installation." } main "$@"