guix-install.sh 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. #!/bin/sh
  2. # GNU Guix --- Functional package management for GNU
  3. # Copyright © 2017 sharlatan <sharlatanus@gmail.com>
  4. # Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  5. # Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
  6. # Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  7. # Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
  8. # Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
  9. # Copyright © 2020 Daniel Brooks <db48x@db48x.net>
  10. # Copyright © 2021 Jakub Kądziołka <kuba@kadziolka.net>
  11. # Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
  12. # Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  13. #
  14. # This file is part of GNU Guix.
  15. #
  16. # GNU Guix is free software; you can redistribute it and/or modify it
  17. # under the terms of the GNU General Public License as published by
  18. # the Free Software Foundation; either version 3 of the License, or (at
  19. # your option) any later version.
  20. #
  21. # GNU Guix is distributed in the hope that it will be useful, but
  22. # WITHOUT ANY WARRANTY; without even the implied warranty of
  23. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. # GNU General Public License for more details.
  25. #
  26. # You should have received a copy of the GNU General Public License
  27. # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  28. # We require Bash but for portability we'd rather not use /bin/bash or
  29. # /usr/bin/env in the shebang, hence this hack.
  30. if [ "x$BASH_VERSION" = "x" ]
  31. then
  32. exec bash "$0" "$@"
  33. fi
  34. set -e
  35. [ "$UID" -eq 0 ] || { echo "This script must be run as root."; exit 1; }
  36. REQUIRE=(
  37. "dirname"
  38. "readlink"
  39. "wget"
  40. "gpg"
  41. "grep"
  42. "which"
  43. "sed"
  44. "sort"
  45. "getent"
  46. "mktemp"
  47. "rm"
  48. "chmod"
  49. "uname"
  50. "groupadd"
  51. "tail"
  52. "tr"
  53. "xz"
  54. )
  55. PAS=$'[ \033[32;1mPASS\033[0m ] '
  56. ERR=$'[ \033[31;1mFAIL\033[0m ] '
  57. WAR=$'[ \033[33;1mWARN\033[0m ] '
  58. INF="[ INFO ] "
  59. DEBUG=0
  60. GNU_URL="https://ftp.gnu.org/gnu/guix/"
  61. #GNU_URL="https://alpha.gnu.org/gnu/guix/"
  62. # The following associative array holds set of GPG keys used to sign the
  63. # releases, keyed by their corresponding Savannah user ID.
  64. declare -A GPG_SIGNING_KEYS
  65. GPG_SIGNING_KEYS[15145]=3CE464558A84FDC69DB40CFB090B11993D9AEBB5 # ludo
  66. GPG_SIGNING_KEYS[127547]=27D586A4F8900854329FF09F1260E46482E63562 # maxim
  67. # ------------------------------------------------------------------------------
  68. #+UTILITIES
  69. _err()
  70. { # All errors go to stderr.
  71. printf "[%s]: %s\n" "$(date +%s.%3N)" "$1"
  72. }
  73. _msg()
  74. { # Default message to stdout.
  75. printf "[%s]: %s\n" "$(date +%s.%3N)" "$1"
  76. }
  77. _debug()
  78. {
  79. if [ "${DEBUG}" = '1' ]; then
  80. printf "[%s]: %s\n" "$(date +%s.%3N)" "$1"
  81. fi
  82. }
  83. # Return true if user answered yes, false otherwise.
  84. # $1: The prompt question.
  85. prompt_yes_no() {
  86. while true; do
  87. read -rp "$1" yn
  88. case $yn in
  89. [Yy]*) return 0;;
  90. [Nn]*) return 1;;
  91. *) _msg "Please answer yes or no."
  92. esac
  93. done
  94. }
  95. chk_require()
  96. { # Check that every required command is available.
  97. declare -a warn
  98. local c
  99. _debug "--- [ ${FUNCNAME[0]} ] ---"
  100. for c in "$@"; do
  101. command -v "$c" &>/dev/null || warn+=("$c")
  102. done
  103. [ "${#warn}" -ne 0 ] &&
  104. { _err "${ERR}Missing commands: ${warn[*]}.";
  105. return 1; }
  106. _msg "${PAS}verification of required commands completed"
  107. }
  108. chk_gpg_keyring()
  109. { # Check whether the Guix release signing public key is present.
  110. _debug "--- [ ${FUNCNAME[0]} ] ---"
  111. local user_id
  112. local gpg_key_id
  113. local exit_flag
  114. for user_id in "${!GPG_SIGNING_KEYS[@]}"; do
  115. gpg_key_id=${GPG_SIGNING_KEYS[$user_id]}
  116. # Without --dry-run this command will create a ~/.gnupg owned by root on
  117. # systems where gpg has never been used, causing errors and confusion.
  118. if ! gpg --dry-run --list-keys "$gpg_key_id" >/dev/null 2>&1; then
  119. if prompt_yes_no "${INF}The following OpenPGP public key is \
  120. required to verify the Guix binary signature: $gpg_key_id.
  121. Would you like me to fetch it for you? (yes/no)"; then
  122. wget "https://sv.gnu.org/people/viewgpg.php?user_id=$user_id" \
  123. -qO - | gpg --import -
  124. else
  125. _err "${ERR}Missing OpenPGP public key ($gpg_key_id).
  126. Fetch it with this command:
  127. wget \"https://sv.gnu.org/people/viewgpg.php?user_id=$user_id\" -qO - | \
  128. sudo -i gpg --import -"
  129. exit_flag=yes
  130. fi
  131. fi
  132. done
  133. if [ "$exit_flag" = yes ]; then
  134. exit 1
  135. fi
  136. }
  137. chk_term()
  138. { # Check for ANSI terminal for color printing.
  139. if [ -t 2 ]; then
  140. if [ "${TERM+set}" = 'set' ]; then
  141. case "$TERM" in
  142. xterm*|rxvt*|urxvt*|linux*|vt*|eterm*|screen*)
  143. ;;
  144. *)
  145. ERR="[ FAIL ] "
  146. PAS="[ PASS ] "
  147. ;;
  148. esac
  149. fi
  150. fi
  151. }
  152. chk_init_sys()
  153. { # Return init system type name.
  154. if [[ $(/sbin/init --version 2>/dev/null) =~ upstart ]]; then
  155. _msg "${INF}init system is: upstart"
  156. INIT_SYS="upstart"
  157. return 0
  158. elif [[ $(systemctl 2>/dev/null) =~ -\.mount ]]; then
  159. _msg "${INF}init system is: systemd"
  160. INIT_SYS="systemd"
  161. return 0
  162. elif [[ -f /etc/init.d/cron && ! -h /etc/init.d/cron ]]; then
  163. _msg "${INF}init system is: sysv-init"
  164. INIT_SYS="sysv-init"
  165. return 0
  166. elif [[ $(openrc --version 2>/dev/null) =~ \(OpenRC\) ]]; then
  167. _msg "${INF}init system is: OpenRC"
  168. INIT_SYS="openrc"
  169. return 0
  170. else
  171. INIT_SYS="NA"
  172. _err "${ERR}Init system could not be detected."
  173. fi
  174. }
  175. chk_sys_arch()
  176. { # Check for operating system and architecture type.
  177. local os
  178. local arch
  179. os="$(uname -s)"
  180. arch="$(uname -m)"
  181. case "$arch" in
  182. i386 | i486 | i686 | i786 | x86)
  183. local arch=i686
  184. ;;
  185. x86_64 | x86-64 | x64 | amd64)
  186. local arch=x86_64
  187. ;;
  188. aarch64)
  189. local arch=aarch64
  190. ;;
  191. armv7l)
  192. local arch=armhf
  193. ;;
  194. ppc64le | powerpc64le)
  195. local arch=powerpc64le
  196. ;;
  197. *)
  198. _err "${ERR}Unsupported CPU type: ${arch}"
  199. exit 1
  200. esac
  201. case "$os" in
  202. Linux | linux)
  203. local os=linux
  204. ;;
  205. *)
  206. _err "${ERR}Your operation system (${os}) is not supported."
  207. exit 1
  208. esac
  209. ARCH_OS="${arch}-${os}"
  210. }
  211. chk_sys_nscd()
  212. { # Check if nscd is up and suggest to start it or install it
  213. if [ "$(type -P pidof)" ]; then
  214. if [ ! "$(pidof nscd)" ]; then
  215. _msg "${WAR}We recommend installing and/or starting your distribution 'nscd' service"
  216. _msg "${WAR}Please read 'info guix \"Application Setup\"' about \"Name Service Switch\""
  217. fi
  218. else
  219. _msg "${INF}We cannot determine if your distribution 'nscd' service is running"
  220. _msg "${INF}Please read 'info guix \"Application Setup\"' about \"Name Service Switch\""
  221. fi
  222. }
  223. # ------------------------------------------------------------------------------
  224. #+MAIN
  225. guix_get_bin_list()
  226. { # Scan GNU archive and save list of binaries
  227. local gnu_url="$1"
  228. local -a bin_ver_ls
  229. local latest_ver
  230. local default_ver
  231. _debug "--- [ ${FUNCNAME[0]} ] ---"
  232. # Filter only version and architecture
  233. bin_ver_ls=("$(wget -qO- "$gnu_url" \
  234. | sed -n -e 's/.*guix-binary-\([0-9.]*[a-z0-9]*\)\..*.tar.xz.*/\1/p' \
  235. | sort -Vu)")
  236. latest_ver="$(echo "${bin_ver_ls[0]}" \
  237. | grep -oE "([0-9]{1,2}\.){2}[0-9]{1,2}[a-z0-9]*" \
  238. | tail -n1)"
  239. default_ver="guix-binary-${latest_ver}.${ARCH_OS}"
  240. if [[ "${#bin_ver_ls}" -ne "0" ]]; then
  241. _msg "${PAS}Release for your system: ${default_ver}"
  242. else
  243. _err "${ERR}Could not obtain list of Guix releases."
  244. exit 1
  245. fi
  246. # Use default to download according to the list and local ARCH_OS.
  247. BIN_VER="${default_ver}"
  248. }
  249. guix_get_bin()
  250. { # Download and verify binary package.
  251. local url="$1"
  252. local bin_ver="$2"
  253. local dl_path="$3"
  254. local wget_args=()
  255. _debug "--- [ ${FUNCNAME[0]} ] ---"
  256. _msg "${INF}Downloading Guix release archive"
  257. wget --help | grep -q '\--show-progress' \
  258. && wget_args=("-q" "--show-progress")
  259. if wget "${wget_args[@]}" -P "$dl_path" \
  260. "${url}/${bin_ver}.tar.xz" "${url}/${bin_ver}.tar.xz.sig"; then
  261. _msg "${PAS}download completed."
  262. else
  263. _err "${ERR}could not download ${url}/${bin_ver}.tar.xz."
  264. exit 1
  265. fi
  266. pushd "${dl_path}" >/dev/null
  267. if gpg --verify "${bin_ver}.tar.xz.sig" >/dev/null 2>&1; then
  268. _msg "${PAS}Signature is valid."
  269. popd >/dev/null
  270. else
  271. _err "${ERR}could not verify the signature."
  272. exit 1
  273. fi
  274. }
  275. sys_create_store()
  276. { # Unpack and install /gnu/store and /var/guix
  277. local pkg="$1"
  278. local tmp_path="$2"
  279. _debug "--- [ ${FUNCNAME[0]} ] ---"
  280. if [[ -e "/var/guix" || -e "/gnu" ]]; then
  281. _err "${ERR}A previous Guix installation was found. Refusing to overwrite."
  282. exit 1
  283. fi
  284. cd "$tmp_path"
  285. tar --extract --file "$pkg" && _msg "${PAS}unpacked archive"
  286. _msg "${INF}Installing /var/guix and /gnu..."
  287. mv "${tmp_path}/var/guix" /var/
  288. mv "${tmp_path}/gnu" /
  289. _msg "${INF}Linking the root user's profile"
  290. mkdir -p "~root/.config/guix"
  291. ln -sf /var/guix/profiles/per-user/root/current-guix \
  292. "~root/.config/guix/current"
  293. GUIX_PROFILE="~root/.config/guix/current"
  294. # shellcheck disable=SC1090
  295. source "${GUIX_PROFILE}/etc/profile"
  296. _msg "${PAS}activated root profile at ${GUIX_PROFILE}"
  297. }
  298. sys_create_build_user()
  299. { # Create the group and user accounts for build users.
  300. _debug "--- [ ${FUNCNAME[0]} ] ---"
  301. if getent group guixbuild > /dev/null; then
  302. _msg "${INF}group guixbuild exists"
  303. else
  304. groupadd --system guixbuild
  305. _msg "${PAS}group <guixbuild> created"
  306. fi
  307. if getent group kvm > /dev/null; then
  308. _msg "${INF}group kvm exists and build users will be added to it"
  309. local KVMGROUP=,kvm
  310. fi
  311. for i in $(seq -w 1 10); do
  312. if id "guixbuilder${i}" &>/dev/null; then
  313. _msg "${INF}user is already in the system, reset"
  314. usermod -g guixbuild -G guixbuild${KVMGROUP} \
  315. -d /var/empty -s "$(which nologin)" \
  316. -c "Guix build user $i" \
  317. "guixbuilder${i}";
  318. else
  319. useradd -g guixbuild -G guixbuild${KVMGROUP} \
  320. -d /var/empty -s "$(which nologin)" \
  321. -c "Guix build user $i" --system \
  322. "guixbuilder${i}";
  323. _msg "${PAS}user added <guixbuilder${i}>"
  324. fi
  325. done
  326. }
  327. sys_enable_guix_daemon()
  328. { # Run the daemon, and set it to automatically start on boot.
  329. local info_path
  330. local local_bin
  331. local var_guix
  332. _debug "--- [ ${FUNCNAME[0]} ] ---"
  333. info_path="/usr/local/share/info"
  334. local_bin="/usr/local/bin"
  335. var_guix="/var/guix/profiles/per-user/root/current-guix"
  336. case "$INIT_SYS" in
  337. upstart)
  338. { initctl reload-configuration;
  339. cp "~root/.config/guix/current/lib/upstart/system/guix-daemon.conf" \
  340. /etc/init/ &&
  341. start guix-daemon; } &&
  342. _msg "${PAS}enabled Guix daemon via upstart"
  343. ;;
  344. systemd)
  345. { # systemd .mount units must be named after the target directory.
  346. # Here we assume a hard-coded name of /gnu/store.
  347. # XXX Work around <https://issues.guix.gnu.org/41356> until next release.
  348. if [ -f "~root/.config/guix/current/lib/systemd/system/gnu-store.mount" ]; then
  349. cp "~root/.config/guix/current/lib/systemd/system/gnu-store.mount" \
  350. /etc/systemd/system/;
  351. chmod 664 /etc/systemd/system/gnu-store.mount;
  352. systemctl daemon-reload &&
  353. systemctl enable gnu-store.mount;
  354. fi
  355. cp "~root/.config/guix/current/lib/systemd/system/guix-daemon.service" \
  356. /etc/systemd/system/;
  357. chmod 664 /etc/systemd/system/guix-daemon.service;
  358. # Work around <https://bugs.gnu.org/36074>, present in 1.0.1.
  359. sed -i /etc/systemd/system/guix-daemon.service \
  360. -e "s/GUIX_LOCPATH='/'GUIX_LOCPATH=/";
  361. # Work around <https://bugs.gnu.org/35671>, present in 1.0.1.
  362. if ! grep en_US /etc/systemd/system/guix-daemon.service >/dev/null;
  363. then sed -i /etc/systemd/system/guix-daemon.service \
  364. -e 's/^Environment=\(.*\)$/Environment=\1 LC_ALL=en_US.UTF-8';
  365. fi;
  366. systemctl daemon-reload &&
  367. systemctl enable guix-daemon &&
  368. systemctl start guix-daemon; } &&
  369. _msg "${PAS}enabled Guix daemon via systemd"
  370. ;;
  371. sysv-init)
  372. { mkdir -p /etc/init.d;
  373. cp "~root/.config/guix/current/etc/init.d/guix-daemon" \
  374. /etc/init.d/guix-daemon;
  375. chmod 775 /etc/init.d/guix-daemon;
  376. update-rc.d guix-daemon defaults &&
  377. update-rc.d guix-daemon enable &&
  378. service guix-daemon start; } &&
  379. _msg "${PAS}enabled Guix daemon via sysv"
  380. ;;
  381. openrc)
  382. { mkdir -p /etc/init.d;
  383. cp "~root/.config/guix/current/etc/openrc/guix-daemon" \
  384. /etc/init.d/guix-daemon;
  385. chmod 775 /etc/init.d/guix-daemon;
  386. rc-update add guix-daemon default &&
  387. rc-service guix-daemon start; } &&
  388. _msg "${PAS}enabled Guix daemon via OpenRC"
  389. ;;
  390. NA|*)
  391. _msg "${ERR}unsupported init system; run the daemon manually:"
  392. echo " ~root/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild"
  393. ;;
  394. esac
  395. _msg "${INF}making the guix command available to other users"
  396. [ -e "$local_bin" ] || mkdir -p "$local_bin"
  397. ln -sf "${var_guix}/bin/guix" "$local_bin"
  398. [ -e "$info_path" ] || mkdir -p "$info_path"
  399. for i in "${var_guix}"/share/info/*; do
  400. ln -sf "$i" "$info_path"
  401. done
  402. }
  403. sys_authorize_build_farms()
  404. { # authorize the public key of the build farm
  405. if prompt_yes_no "Permit downloading pre-built package binaries from the \
  406. project's build farm? (yes/no) "; then
  407. guix archive --authorize \
  408. < "~root/.config/guix/current/share/guix/ci.guix.gnu.org.pub" \
  409. && _msg "${PAS}Authorized public key for ci.guix.gnu.org"
  410. else
  411. _msg "${INF}Skipped authorizing build farm public keys"
  412. fi
  413. }
  414. sys_create_init_profile()
  415. { # Define for better desktop integration
  416. # This will not take effect until the next shell or desktop session!
  417. [ -d "/etc/profile.d" ] || mkdir /etc/profile.d # Just in case
  418. cat <<"EOF" > /etc/profile.d/guix.sh
  419. # _GUIX_PROFILE: `guix pull` profile
  420. _GUIX_PROFILE="$HOME/.config/guix/current"
  421. export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH"
  422. # Export INFOPATH so that the updated info pages can be found
  423. # and read by both /usr/bin/info and/or $GUIX_PROFILE/bin/info
  424. # When INFOPATH is unset, add a trailing colon so that Emacs
  425. # searches 'Info-default-directory-list'.
  426. export INFOPATH="$_GUIX_PROFILE/share/info:$INFOPATH"
  427. # GUIX_PROFILE: User's default profile
  428. GUIX_PROFILE="$HOME/.guix-profile"
  429. [ -L $GUIX_PROFILE ] || return
  430. GUIX_LOCPATH="$GUIX_PROFILE/lib/locale"
  431. export GUIX_PROFILE GUIX_LOCPATH
  432. [ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile"
  433. # set XDG_DATA_DIRS to include Guix installations
  434. export XDG_DATA_DIRS="$GUIX_PROFILE/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}"
  435. EOF
  436. }
  437. sys_create_shell_completion()
  438. { # Symlink supported shell completions system-wide
  439. var_guix=/var/guix/profiles/per-user/root/current-guix
  440. bash_completion=/etc/bash_completion.d
  441. zsh_completion=/usr/share/zsh/site-functions
  442. fish_completion=/usr/share/fish/vendor_completions.d
  443. { # Just in case
  444. for dir_shell in $bash_completion $zsh_completion $fish_completion; do
  445. [ -d "$dir_shell" ] || mkdir -p $dir_shell
  446. done;
  447. ln -sf ${var_guix}/etc/bash_completion.d/* "$bash_completion";
  448. ln -sf ${var_guix}/share/zsh/site-functions/* "$zsh_completion";
  449. ln -sf ${var_guix}/share/fish/vendor_completions.d/* "$fish_completion"; } &&
  450. _msg "${PAS}installed shell completion"
  451. }
  452. welcome()
  453. {
  454. cat<<"EOF"
  455. ░░░ ░░░
  456. ░░▒▒░░░░░░░░░ ░░░░░░░░░▒▒░░
  457. ░░▒▒▒▒▒░░░░░░░ ░░░░░░░▒▒▒▒▒░
  458. ░▒▒▒░░▒▒▒▒▒ ░░░░░░░▒▒░
  459. ░▒▒▒▒░ ░░░░░░
  460. ▒▒▒▒▒ ░░░░░░
  461. ▒▒▒▒▒ ░░░░░
  462. ░▒▒▒▒▒ ░░░░░
  463. ▒▒▒▒▒ ░░░░░
  464. ▒▒▒▒▒ ░░░░░
  465. ░▒▒▒▒▒░░░░░
  466. ▒▒▒▒▒▒░░░
  467. ▒▒▒▒▒▒░
  468. _____ _ _ _ _ _____ _
  469. / ____| \ | | | | | / ____| (_)
  470. | | __| \| | | | | | | __ _ _ ___ __
  471. | | |_ | . ' | | | | | | |_ | | | | \ \/ /
  472. | |__| | |\ | |__| | | |__| | |_| | |> <
  473. \_____|_| \_|\____/ \_____|\__,_|_/_/\_\
  474. This script installs GNU Guix on your system
  475. https://www.gnu.org/software/guix/
  476. EOF
  477. echo -n "Press return to continue..."
  478. read -r
  479. }
  480. main()
  481. {
  482. local tmp_path
  483. welcome
  484. _msg "Starting installation ($(date))"
  485. chk_term
  486. chk_require "${REQUIRE[@]}"
  487. chk_gpg_keyring
  488. chk_init_sys
  489. chk_sys_arch
  490. chk_sys_nscd
  491. _msg "${INF}system is ${ARCH_OS}"
  492. umask 0022
  493. tmp_path="$(mktemp -t -d guix.XXX)"
  494. if [ -z "${GUIX_BINARY_FILE_NAME}" ]; then
  495. guix_get_bin_list "${GNU_URL}"
  496. guix_get_bin "${GNU_URL}" "${BIN_VER}" "$tmp_path"
  497. GUIX_BINARY_FILE_NAME=${BIN_VER}.tar.xz
  498. else
  499. if ! [[ $GUIX_BINARY_FILE_NAME =~ $ARCH_OS ]]; then
  500. _err "$ARCH_OS not in ${GUIX_BINARY_FILE_NAME}; aborting"
  501. fi
  502. _msg "${INF}Using manually provided binary ${GUIX_BINARY_FILE_NAME}"
  503. GUIX_BINARY_FILE_NAME=$(realpath "$GUIX_BINARY_FILE_NAME")
  504. fi
  505. sys_create_store "${GUIX_BINARY_FILE_NAME}" "${tmp_path}"
  506. sys_create_build_user
  507. sys_enable_guix_daemon
  508. sys_authorize_build_farms
  509. sys_create_init_profile
  510. sys_create_shell_completion
  511. _msg "${INF}cleaning up ${tmp_path}"
  512. rm -r "${tmp_path}"
  513. _msg "${PAS}Guix has successfully been installed!"
  514. _msg "${INF}Run 'info guix' to read the manual."
  515. # Required to source /etc/profile in desktop environments.
  516. _msg "${INF}Please log out and back in to complete the installation."
  517. }
  518. main "$@"