aboutsummaryrefslogtreecommitdiff
path: root/etc/guix-install.sh
Commit message (Collapse)AuthorAge
* guix-install.sh: Authorize all project build farms at once.Tobias Geerinckx-Rice2022-12-09
| | | | | | | * etc/guix-install.sh (sys_authorize_build_farms): Iterate over all hosts. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* guix-install.sh: Expand mktemp template for busybox compatibility.Maxim Cournoyer2022-11-16
| | | | | | | | | | Fixes <https://issues.guix.gnu.org/58858>. * etc/guix-install.sh (main): Use 6 'X' characters in the template, as this is the minimum required by Busybox's mktemp (which matches glibc's mktemp behavior). Reported-by: conses <contact@conses.eu>
* guix-install.sh: Remove unnecessary XDG_DATA_DIRS export.Prafulla Giri2022-11-14
| | | | | | | | | | | | | | | | This started out as a bug-fix for a GUI login loop that was resulting from XDG_DATA_DIRS not including any of the host distro's directories. The solution was to export the vari- able (with fail-safe defaults) before source-ing GUIX_PROFILE/etc/profile. It turns out changes have already been made to ensure that XDG_DATA_DIRS, etc. are always exported before anything guix-specific. So, this export is no longer necessary. For reference, the aforementioned bug was found on a Debian 11 machine and it's guix.sh init profile for guix version 1.2. * etc/guix-install.sh (sys_create_init_profile): Remove unnecessary XDG_DATA_DIRS export. Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
* guix-install.sh: Run guix.sh script in /etc/profile.d last.Konrad Hinsen2022-11-08
| | | | | | | | | | | | * etc/guix-install.sh: Rename /etc/profile.d/guix.sh to zzz-guix.sh. This script refers to environment variables set by the host distribution. They may be set in other scripts in /etc/profile.d, which must therefore be run first. Example: in Ubuntu 20.04, XDG_DATA_DIRS is set in /etc/profile.d/xdg_dirs_desktop_session.sh Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* guix-install.sh: Cosmetically tweak non-interactive output.Tobias Geerinckx-Rice2022-10-16
| | | | | | | | | | | | Avoid printing Press return to continue...[1666352494.051]: Starting installation… [1666352648.869]: … when the return itself wasn't echoed on the console. * etc/guix-install.sh (welcome): Add a carriage return to the prompt, so that the next line of output may overwrite it.
* guix-install.sh: Warn if we suspect dodgy automation.Tobias Geerinckx-Rice2022-10-16
| | | | | | | This doesn't affect the installation (yet), but reserves the right to default to safe values other than ‘y’ in future. * etc/guix-install.sh (welcome): Warn if the ‘return’ wasn't.
* guix-install.sh: Treat all uncaught errors as fatal.Tobias Geerinckx-Rice2022-10-16
| | | | * etc/guix-install.sh: Set -o pipefail.
* guix-install.sh: Suggest what to do if fetching OpenPGP key(s) fails.Tobias Geerinckx-Rice2022-10-16
| | | | | * etc/guix-install.sh (chk_gpg_keyring): Report an _err and set the exit_flag if wget | gpg --import fails.
* guix-install.sh: Time out fetching OpenPGP keys.Tobias Geerinckx-Rice2022-10-16
| | | | | | The default 900s provide no useful backstop in interactive use. * etc/guix-install.sh (chk_gpg_keyring): Add a 30s wget --timeout.
* guix-install.sh: Restore compatibility with "yes" invocation.Maxim Cournoyer2022-10-11
| | | | | | | | | | | | | | | | Commit 6a2e303d3a had modified prompt_yes_no to only read a single character, aiming to ease the user experience. This was, in retrospect, a bad idea, as it makes user input error more likely and introduces complexity. This commit reverts to line-oriented input, while preserving the default yes value so that a user can simply hit 'Enter' at the prompt in place of typing "yes". * etc/guix-install.sh (_flush): Delete function. (prompt_yes_no): Restore line-oriented read. Remove loop. Make anything else than yes means no. Use Bash features to streamline definition. Reported-by: Lars-Dominik Braun <lars@6xq.net> and others.
* guix-install.sh: Add Bash prompt customization option.Maxim Cournoyer2022-10-07
| | | | | | | Fixes <https://issues.guix.gnu.org/55484>. * etc/guix-install.sh (sys_customize_bashrc): New function. (main): Use it.
* guix-install.sh: Introduce 'die' utility function.Maxim Cournoyer2022-10-07
| | | | | | * etc/guix-install.sh (die): New function. (chk_sys_arch): Use it. (guix_get_bin_list, guix_get_bin, sys_create_store): Likewise.
* guix-install.sh: Improve prompt_yes_no procedure.Maxim Cournoyer2022-10-07
| | | | | | | | | | * etc/guix-install.sh (_flush): New function. (prompt_yes_no): Clear input, then only read the first character, silently. Add the [Yes/no] string to the message. When a newline is entered by the user, treat it as the default value, which is "yes". (chk_gpg_keyring): Remove "(yes/no)" from the prompt message. (configure_substitute_discovery): Likewise. (sys_authorize_build_farms): Likewise.
* etc/guix-install.sh: Check for profile from 'guix home'.Philip McGrath2022-07-04
| | | | | | | | | | If "$HOME/.guix-home/profile" exists, use it for GUIX_PROFILE instead of "$HOME/.guix-profile". * etc/guix-install.sh (sys_create_init_profile): Check for 'guix home' profile. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* etc/guix-install.sh: Initialize XDG base directories.Philip McGrath2022-07-04
| | | | | | | | | | | | | | | | The default values from the XDG base directory specification make little sense for Guix System, and some scripts in Guix assume that they are not "empty or unset": for example, see <https://issues.guix.gnu.org/56050>. On foreign distros, however, omitting the default values is likely to break software from the distro, perhaps even preventing the desktop environment from starting. To smooth over the difference, use the system-wide configuration to ensure the environment variables are always explicitly set on foreign distros. * etc/guix-install.sh (sys_create_init_profile): Explicitly initialize XDG base directory variables. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix-install.sh: Undo some bugs introduced by shellcheck.Tobias Geerinckx-Rice2021-11-07
| | | | * etc/guix-install.sh: Unquote all file names containing ~root.
* guix-install.sh: Don't swallow wget errors.Tobias Geerinckx-Rice2021-09-29
| | | | | | | | | Using ‘-q’ suppresses *all* stderr output, including errors. * etc/guix-install.sh (chk_gpg_keyring, guix_get_bin_list, guix_get_bin): Substitute ‘--no-verbose’ for ‘-q’. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>
* guix-install.sh: Untabify.Maxim Cournoyer2021-07-14
| | | | * etc/guix-install.sh (sys_create_build_user): Normalize to spaces.
* guix-install.sh: Prompt for configuring substitutes discovery.Maxim Cournoyer2021-07-07
| | | | | | | | | | | | | | | | Also ensure prompt_yes_no always print the message with a trailing space, which is more pleasing to the eye. * etc/guix-daemon.conf.in <--discover=no>: New guix-daemon option. * etc/guix-daemon.service.in: Likewise. * etc/init.d/guix-daemon.in: Likewise. * etc/openrc/guix-daemon.in: Likewise. * etc/guix-install.sh (configure_substitute_discovery): New procedure. (sys_enable_guix_daemon): Ask the user whether automatic substitute discovery should be enabled. Set the '--discover' argument accordingly. (prompt_yes_no): Add a trailing space to the message. (sys_authorize_build_farms): Remove trailing space from the message argument. * NEWS (Distribution): Add news.
* guix-install.sh: No longer export GUIX_PROFILE.Hartmut Goebel2021-07-07
| | | | | | | | If GUIX_PROFILE is exported here, any subsequent "source /some/other/profile/etc/profile" will set variables pointing to "$HOME/.guix-profile" instead of pointing to the sourced profile. * etc/guix-install.sh (sys_create_init_profile): No longer export GUIX_PROFILE.
* guix-install.sh: Exit early if Guix is already installed.Maxim Cournoyer2021-05-05
| | | | | * etc/guix-install.sh (sys_create_store): Move the check & exit before The Guix binary archive is unpacked. Re-indent tar extraction command.
* guix-install.sh: Propose automatically fetching OpenPGP keys.Maxim Cournoyer2021-05-05
| | | | | | | Via, for example, yes | ./guix-install.sh. * etc/guix-install.sh (prompt_yes_no): New procedure. (chk_gpg_keyring, sys_authorize_build_farms): Use it.
* guix-install.sh: Please the shellcheck linter.Maxim Cournoyer2021-05-05
| | | | | | | | | | | | | | | | * etc/guix-install.sh <FUNCNAME>: Explicitly refer to the first item of the FUNCNAME array. (ROOT_HOME): Replace variable by ~root directly; manually expanding it via echo was not necessary. (chk_gpg_keyring): Use an if branch for the exit to avoid a warning about expression precedence. (chk_term) <ansi_term>: Remove unused variable. (guix_get_bin) <wget, gpg>: Test the commands directly. Use an array for the wget arguments, which can then be properly expanded. (sys_create_store): Disable SC1090 for the source command, as we don't care about following the sourced script. <_msg>: Reuse the GUIX_PROFILE variable in the message. (sys_create_build_user) <getent>: Test the command directly.
* guix-install.sh: Add support for more than one signing key.Maxim Cournoyer2021-05-01
| | | | | | | | | | The forthcoming 1.3.0 release will be signed with my personal GnuPG key; the installation script need to tell users how fetch it. * etc/guix-install.sh (OPENPGP_SIGNING_KEY_ID): Remove variable. (GPG_SIGNING_KEYS): New associative array. (chk_gpg_keyring): Process all the keys contained in the above array. (main) <GUIX_BINARY_FILE_NAME>: Double quote variable.
* guix-install.sh: Ensure GUIX_BINARY_FILE_NAME is an absolute path.Maxim Cournoyer2021-04-29
| | | | | | | | This is necessary as the directory context is changed in the script, breaking the use of a relative path. * etc/guix-install.sh (main) <GUIX_BINARY_FILE_NAME>: Resolve its absolute path via the 'realpath' command.
* guix-install.sh: Allow overriding the Guix binary source.Maxim Cournoyer2021-04-24
| | | | | | | | | This is useful for example for testing release candidates not yet uploaded to the FTP, or for testing manually downloaded images from the CI. * etc/guix-install.sh (main)[GUIX_BINARY_FILE_NAME]: When this variable is defined, use it as the file name of a Guix binary, instead of automatically retrieving the latest archive from the FTP.
* guix-install.sh: Add the build users to the 'kvm' group.Leo Famulari2021-04-14
| | | | | | | Fixes <https://bugs.gnu.org/42129>. * etc/guix-install.sh (sys_create_build_user): If a 'kvm' group exists, add it to the guixbuilders' lists of supplementary groups.
* Add powerpc64le-linux as a supported Guix architecture.Chris Marusich2021-03-23
| | | | | | | | | | | This makes powerpc64le-linux a supported architecture for Guix, but not for Guix System. * Makefile.am (SUPPORTED_SYSTEMS): Add an entry for powerpc64le-linux. * etc/guix-install.sh (chk_sys_arch): Same. * guix/packages.scm (%supported-systems): Same. * m4/guix.m4 (GUIX_ASSERT_SUPPORTED_SYSTEM): Same. * tests/guix-build.sh (all_systems): Same.
* /etc/profile.d/guix.sh: Add guix pull profile even when absentJakub Kądziołka2021-01-03
| | | | | | | | | | | | | | * 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.
* guix-install.sh: Add variable quoting and curly-bracketing.Vincent Legoll2020-12-18
| | | | | | | * etc/guix-install.sh (guix_get_bin)[dl_path]: Add variable quoting and curly-bracketing. Signed-off-by: Christopher Baines <mail@cbaines.net>
* guix-install.sh: Adjust variable use in guix_get_bin_list().Vincent Legoll2020-12-18
| | | | | | | * etc/guix-install.sh (guix_get_bin_list)[BIN_VER]: Add curly-brackets, [latest_ver]: Likewise & add explicit array zero-indexing. Signed-off-by: Christopher Baines <mail@cbaines.net>
* guix-install.sh: Add variable quoting in sys_make_guix_available.Vincent Legoll2020-12-18
| | | | | | * etc/guix-install.sh (sys_make_guix_available): Add variable quoting. Signed-off-by: Christopher Baines <mail@cbaines.net>
* guix-install.sh: Replace tabs with spaces.Vincent Legoll2020-12-18
| | | | | | | | | | Almost the entire file is indented with spaces, a few tabs slipped in, clean them up. * etc/guix-install.sh(chk_sys_arch): Replace tabs with spaces. (sys_enable_guix_daemon): Likewise. Signed-off-by: Christopher Baines <mail@cbaines.net>
* guix-install.sh: don't throw away release candidates when picking the latest ↵Daniel Brooks2020-11-15
| | | | | | | | version * etc/guix-install.sh (guix_get_bin_list): modify regexes to allow rcN syntax Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix-install.sh: Check the service 'nscd' and suggest it.zimoun2020-10-16
| | | | | | | | | Fixes <https://bugs.gnu.org/43744>. * etc/guix-install.sh (chk_sys_nscd): New function to check if the service 'nscd is running, otherwise suggest to install distribution-wide. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix-install.sh: Add symbolic links for supported shell completions.zimoun2020-10-16
| | | | | | | | | Fixes <https://bugs.gnu.org/43744>. * etc/guix-install.sh (sys_create_shell_completion): New function to add system wide all the symlinks for supported shell completions. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix-install.sh: Support OpenRC.Morgan Smith2020-09-17
| | | | | | | | | | | | | * etc/guix-install.sh (chk_init_sys): Detect OpenRC. (sys_enable_guix_daemon): Install & enable the Guix daemon on such systems. * etc/openrc/guix-daemon.in: New file. * nix/local.mk: Add a rule for it. (openrcservicedir, nodist_openrcservice_DATA): New variables. (CLEANFILES, EXTRA_DIST): Add them. * .gitignore: Ignore etc/openrc/guix-daemon. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
* guix-install.sh: Be POSIX-compliant.Morgan Smith2020-09-17
| | | | | | | | * etc/guix-install.sh (guix_get_bin_list): Call grep with an extended regular expression instead of a non-POSIX Perl regular expression. (sys_create_store): Remove ‘--warning=no-timestamp’ argument to tar. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
* guix-install.sh: Quote the OpenPGP key URL.Ludovic Courtès2020-09-09
| | | | | | | Without quotes, zsh fails with "no matches found" as it tries to interpret the question mark. * etc/guix-install.sh (chk_gpg_keyring): Enclose URL in single quotes.
* guix-install.sh: Make sure /etc/profile is sourced.Tobias Geerinckx-Rice2020-07-16
| | | | | | New users regularly report missing newly-installed programmes and icons. * etc/guix-install.scm (main): Tell users to log out & back in.
* guix-install.sh: Suggest running gpg as root.Tobias Geerinckx-Rice2020-07-16
| | | | | | | The original example regularly prevented new users from installing Guix at all. * etc/guix-install.scm (chk_gpg_keyring): Suggest ‘sudo -i gpg’.
* etc: Enable mount unit only if it exists.Tobias Geerinckx-Rice2020-07-14
| | | | | | | * etc/guix-install.sh (sys_enable_guix_daemon): Enable gnu-store.mount only if it was actually installed. Reported by peanutbutterandc on #guix.
* guix-install.sh: Fix ‘systemctl not found’ error message at probe.Vincent Legoll2020-05-23
| | | | | | | * etc/guix-install.sh (chk_init_sys): Redirect systemctl errors to /dev/null. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
* guix-install.sh: Add xz to requirements.Vincent Legoll2020-05-23
| | | | | | * etc/guix-install.sh (REQUIRE): Add xz to requirements list. Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
* etc: Install mount unit only if it exists.Tobias Geerinckx-Rice2020-05-17
| | | | | | | | | | | | This follows up on 1a1faa78b0498fbb71f1533beb4b65817c1d3f2a, and avoids the (non-fatal) error seen in <https://issues.guix.gnu.org/41356>. /gnu/store will remain writable on new foreign distribution installations until the next release. * etc/guix-install.sh (sys_enable_guix_daemon): Check for ‘gnu-store.mount’ presence before trying to cp it. Update forgotten copyright header.
* etc: Add a systemd unit to bind-mount @storedir@ read-only.Tobias Geerinckx-Rice2020-05-16
| | | | | | | | | * etc/gnu-store.mount.in: New file. * nix/local.mk (nodist_systemdservice_DATA): Add it. (etc/%.mount): New rule for it. * etc/guix-install.sh (sys_enable_guix_daemon): Install it. * doc/guix.texi (Binary Installation): Document it. * .gitignore: Ignore changes to it.
* guix-install.sh: /etc/profile.d/guix.sh sources ~/.guix-profile/etc/profile.Ludovic Courtès2020-03-22
| | | | | | * etc/guix-install.sh (sys_create_init_profile): Source ~/.guix-profile/etc/profile instead of running 'guix package --search-paths=prefix'
* guix-install.sh: Add a trailing colon to 'INFOPATH'.Ludovic Courtès2020-03-22
| | | | | | | | Fixes <https://bugs.gnu.org/39984>. Suggested by Adam Porter <adam@alphapapa.net>. * etc/guix-install.sh (sys_create_init_profile): Add a trailing colon to 'INFOPATH'.
* guix-install.sh: Install SysV init script.Danny Milosavljevic2020-03-11
| | | | * etc/guix-install.sh (sys_enable_guix_daemon): Install SysV init script.
* guix-install.sh: Correctly treat empty or unset $XDG_DATA_DIRSAlexander Krotov2020-01-26
| | | | | | | | | | | | | | | | | If $XDG_DATA_DIRS is unset, default value of "/usr/local/share:/usr/share" is used according to XDG Base Directory Specification. However, /etc/profile.d/guix.sh treats this value as empty list when appending its own directory, so after installing Guix on the system, launchers such as Rofi stop searching for .desktop files in /usr/share/applications/ and can't launch applications other than those installed with Guix. This patch fixes the bug in generated /etc/profile.d/guix.sh * etc/guix-install.sh (sys_create_init_profile): Use default value of /usr/local/share:/usr/share/ before appending if $XDG_DATA_DIRS is not set. Signed-off-by: Ludovic Courtès <ludo@gnu.org>