Commit graph

52 commits

Author SHA1 Message Date
Maxim Cournoyer
74009c4cf0
guix-install.sh: Exit early if Guix is already installed.
* etc/guix-install.sh (sys_create_store): Move the check & exit before The
Guix binary archive is unpacked.  Re-indent tar extraction command.
2021-05-05 11:01:07 -04:00
Maxim Cournoyer
5b0ce3393b
guix-install.sh: Propose automatically fetching OpenPGP keys.
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.
2021-05-05 11:01:07 -04:00
Maxim Cournoyer
e61fe664a4
guix-install.sh: Please the shellcheck linter.
* 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.
2021-05-05 11:01:06 -04:00
Maxim Cournoyer
185709221d
guix-install.sh: Add support for more than one signing key.
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.
2021-05-01 01:03:18 -04:00
Maxim Cournoyer
8214e70fa8
guix-install.sh: Ensure GUIX_BINARY_FILE_NAME is an absolute path.
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.
2021-04-29 14:09:22 -04:00
Maxim Cournoyer
51f95d4e64
guix-install.sh: Allow overriding the Guix binary source.
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.
2021-04-24 10:32:40 -04:00
Leo Famulari
8e214c53a4
guix-install.sh: Add the build users to the 'kvm' group.
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.
2021-04-14 15:32:51 -04:00
Chris Marusich
a16eb6c5f9
Add powerpc64le-linux as a supported Guix architecture.
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.
2021-03-23 23:19:57 -07:00
Jakub Kądziołka
9d34b04f40
/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.
2021-01-03 17:01:26 +01:00
Vincent Legoll
d2532317d1
guix-install.sh: Add variable quoting and curly-bracketing.
* etc/guix-install.sh (guix_get_bin)[dl_path]: Add variable quoting and
curly-bracketing.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2020-12-18 12:21:25 +00:00
Vincent Legoll
1f4e878fc4
guix-install.sh: Adjust variable use in guix_get_bin_list().
* 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>
2020-12-18 12:21:15 +00:00
Vincent Legoll
b4a1252b71
guix-install.sh: Add variable quoting in sys_make_guix_available.
* etc/guix-install.sh (sys_make_guix_available): Add variable quoting.

Signed-off-by: Christopher Baines <mail@cbaines.net>
2020-12-18 12:21:11 +00:00
Vincent Legoll
7c16406809
guix-install.sh: Replace tabs with spaces.
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>
2020-12-18 12:20:59 +00:00
Daniel Brooks
8311e4e1d1
guix-install.sh: don't throw away release candidates when picking the latest version
* etc/guix-install.sh (guix_get_bin_list): modify regexes to allow rcN syntax

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-11-15 22:31:20 +01:00
zimoun
b2683a2bed
guix-install.sh: Check the service 'nscd' and suggest it.
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>
2020-10-16 15:00:50 +02:00
zimoun
b3fba5ef04
guix-install.sh: Add symbolic links for supported shell completions.
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>
2020-10-16 15:00:50 +02:00
Morgan Smith
cabac732de
guix-install.sh: Support OpenRC.
* 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>
2020-09-17 14:10:42 +02:00
Morgan Smith
f72bafe32d
guix-install.sh: Be POSIX-compliant.
* 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>
2020-09-17 14:10:42 +02:00
Ludovic Courtès
ea0da48681
guix-install.sh: Quote the OpenPGP key URL.
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.
2020-09-09 09:28:12 +02:00
Tobias Geerinckx-Rice
2ffd1314cd
guix-install.sh: Make sure /etc/profile is sourced.
New users regularly report missing newly-installed programmes and icons.

* etc/guix-install.scm (main): Tell users to log out & back in.
2020-07-16 20:12:07 +02:00
Tobias Geerinckx-Rice
4089d7920f
guix-install.sh: Suggest running gpg as root.
The original example regularly prevented new users from installing Guix
at all.

* etc/guix-install.scm (chk_gpg_keyring): Suggest ‘sudo -i gpg’.
2020-07-16 20:12:07 +02:00
Tobias Geerinckx-Rice
d6f303d4e5
etc: Enable mount unit only if it exists.
* etc/guix-install.sh (sys_enable_guix_daemon): Enable gnu-store.mount only
if it was actually installed.

Reported by peanutbutterandc on #guix.
2020-07-14 13:17:13 +02:00
Vincent Legoll
dc1aede30a
guix-install.sh: Fix ‘systemctl not found’ error message at probe.
* etc/guix-install.sh (chk_init_sys): Redirect systemctl errors to
/dev/null.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2020-05-23 15:37:58 +02:00
Vincent Legoll
39939e30cf
guix-install.sh: Add xz to requirements.
* etc/guix-install.sh (REQUIRE): Add xz to requirements list.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2020-05-23 15:37:58 +02:00
Tobias Geerinckx-Rice
ebbf915422
etc: Install mount unit only if it exists.
This follows up on 1a1faa78b0, 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.
2020-05-17 14:12:35 +02:00
Tobias Geerinckx-Rice
1a1faa78b0
etc: Add a systemd unit to bind-mount @storedir@ read-only.
* 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.
2020-05-16 15:37:41 +02:00
Ludovic Courtès
e69b8bbae9
guix-install.sh: /etc/profile.d/guix.sh sources ~/.guix-profile/etc/profile.
* etc/guix-install.sh (sys_create_init_profile): Source
~/.guix-profile/etc/profile instead of running 'guix package
--search-paths=prefix'
2020-03-22 00:02:23 +01:00
Ludovic Courtès
3c69701f97
guix-install.sh: Add a trailing colon to 'INFOPATH'.
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'.
2020-03-22 00:02:23 +01:00
Danny Milosavljevic
fe60ef998f
guix-install.sh: Install SysV init script.
* etc/guix-install.sh (sys_enable_guix_daemon): Install SysV init script.
2020-03-11 02:45:49 +01:00
Alexander Krotov
7ff169d04f
guix-install.sh: Correctly treat empty or unset $XDG_DATA_DIRS
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>
2020-01-26 23:21:39 +01:00
Prafulla Giri
29ba58c0ef
guix-install.sh: Create /etc/profile.d if it does not exist
* etc/guix-install.sh (sys_create_init_profile): Add code to create
/etc/profile.d if it somehow does not exist; the function still carries
on because it is possible that /etc/profile is still configured to read
the *.sh files from /etc/profile.d, if they exist.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-01-26 23:21:39 +01:00
Prafulla Giri
5c03516a6b
guix-install.sh: Export INFOPATH to contain updated guix info-pages
* etc/guix-install.sh (sys_create_init_profile): Export INFOPATH to include
the updated info-pages from ~/.config/guix/current/share/info.  This also makes
sure that both /usr/bin/info and $GUIX_PROFILE/bin/info can read guix info pages
without throwing "no menu item 'guix' in node dir(Top)" error.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-01-26 23:21:39 +01:00
Prafulla Giri
30810aff71
guix-install.sh: Create an init profile during installation
Create an init profile (/etc/profile.d/guix.sh) during installation for
better integration with foreign distros. This file, read by login-shells
sets a few environment variables (PATH, GUIX_PROFILE, GUIX_LOCALE, along
with XDG_DATA_DIRS) and makes guix-installed packages readily available
for the users. Other environment variables, as listed by `guix package
--search-paths=prefix`, are also exported.

Checks are in place to prevent the init profile from needlessly polluting
the user's environment.

* etc/guix-install.sh (sys_create_init_profile): New function to create
/etc/profile.d/guix.sh init profile.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2020-01-17 17:28:57 +01:00
Tobias Geerinckx-Rice
32c06affca
guix-install.sh: Use a deterministic umask.
Users with strict umasks (e.g. 0077) would end up with an unreadable
/gnu (mode 0700) and no way to run guix.

Reported by A. <@aaap:matrix.org> on #guix.

* etc/guix-install.sh (main): Set umask before installing anything.
2019-12-04 03:59:04 +01:00
Ludovic Courtès
e1e3fe0848
guix-install.sh: Work around locale issues in 'guix-daemon.service'.
* etc/guix-install.sh (sys_enable_guix_daemon): Modify
'guix-daemon.service' to work around locale issues not fixed in 1.0.1.
2019-09-05 18:33:30 +02:00
Tobias Geerinckx-Rice
9b2644c292
guix-install.sh: Don't initialise ~/.gnupg.
* etc/guix-install.sh (chk_gpg_keyring): Call gpg with ‘--dry-run’.
2019-07-08 18:16:10 +02:00
Tobias Geerinckx-Rice
5d8e505ce5
guix-install.sh: Check for PGP key separately.
* etc/guix-install.sh (chk_gpg_keyring): New function to handle the
public key check previously stuffed into chk_require.
(main): Call it.
2019-07-08 18:16:10 +02:00
Tobias Geerinckx-Rice
7a2e0c52df
guix-install.sh: Add missing ‘local’ declaration.
* etc/guix-install.sh (chk_require): Make $c local.
2019-07-08 17:47:39 +02:00
Tobias Geerinckx-Rice
6c77d79a49
guix-install.sh: Treat REQUIRE as the array it is.
Don't flatten it into a string only to split it again later.

* etc/guix-install.sh (chk_require): Iterate over array elements, not
string tokens.
(main): Pass $REQUIRE as an array of arguments.
2019-07-08 17:47:39 +02:00
Ricardo Wurmus
cea5db1b84
etc: Do not recommend use of SKS key servers.
* etc/guix-install.sh: Recommend downloading the GPG key from Savannah.
2019-07-01 23:32:08 +02:00
Tobias Geerinckx-Rice
414c4de15d
guix-install.sh: Don't authorise hydra.gnu.org.
* etc/guix-install.sh (sys_authorize_build_farms): Authorise only
ci.guix.gnu.org and make all references to it singular.
2019-06-29 06:28:50 +02:00
Ricardo Wurmus
825c39bfbb
etc: Refer to ci.guix.gnu.org in install script.
* etc/guix-install.sh: Replace reference to ci.guix.info with ci.guix.gnu.org.
2019-05-10 23:38:10 +02:00
Ludovic Courtès
3a3e9f2bb5
guix-install.sh: Update URL.
* etc/guix-install.sh (GNU_URL): Change to ftp.gnu.org.
2019-05-02 15:31:24 +02:00
Ludovic Courtès
f5fdc54d3a
guix-install.sh: Avoid "#!/bin/bash" shebang.
Fixes <https://bugs.gnu.org/34279>.
Reported by Claes Wallin (韋嘉誠) <clacke@lysator.liu.se>.

* etc/guix-install.sh: Change shebang to #!/bin/sh and add 'if'
statement to spawn Bash if needed.
2019-02-05 12:03:24 +01:00
Ludovic Courtès
1fc90e89f0
guix-install.sh: Use pool.sks-keyservers.net.
"pgp.mit.edu" has been unavailable for some time.

* etc/guix-install.sh (chk_require): Change key server to
pool.sks-keyservers.net.
2018-12-13 18:44:40 +01:00
Ludovic Courtès
4a0b87f0ec
guix-install.sh: Use the "ci.guix.info.pub" file name for clarity.
* etc/guix-install.sh (sys_authorize_build_farms): Use the
"ci.guix.info.pub" file name rather "berlin.guixsd.org.pub".
2018-12-05 16:26:55 +01:00
Ludovic Courtès
e9926f80c6
build: Binary tarball now populates the "current-guix" profile.
* Makefile.am (guix-binary.%.tar.xz): Pass
'--profile-name=current-guix'.  Remove glibc and glibc-utf8-locales.
* doc/guix.texi (Binary Installation): Update accordingly.
* etc/guix-install.sh
* etc/guix-install.sh (sys_create_store, sys_enable_guix_daemon)
(sys_authorize_build_farms): Likewise.
* etc/guix-publish.conf.in, etc/guix-publish.service.in,
etc/guix-daemon.conf.in, etc/guix-daemon.service.in: Update file names
accordingly.
2018-11-23 15:42:01 +01:00
Ludovic Courtès
2510bd8756
guix-install.sh: Recognize armhf-linux.
* etc/guix-install.sh (chk_sys_arch): Add "armv7l" case.
2018-10-14 23:48:49 +02:00
Maxim Cournoyer
593fe73667
guix-install.sh: Fix chk_require exiting without warning.
* etc/guix-install.sh (chk_require): Because of the set -e option, Bash was
exiting when the command `command -v "$c" &>/dev/null' was running on its
own. Instead, we now test the command and accumulate warning messages in a
single statement by chaining the command with a logical OR.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2018-05-19 22:47:07 +02:00
Chris Marusich
3cd4447f56
guix-install.sh: Explicitly set root's home directory.
* etc/guix-install.sh (ROOT_HOME): New variable.
  (sys_create_store, sys_enable_guix_daemon, sys_authorize_build_farms):
  Use ROOT_HOME instead of ~root or the HOME environment variable.
* doc/guix.texi (Binary Installation): Instead of assuming that ~ and
  $HOME refer to root's directory simply because commands are being run
  as root, explicilty refer to it via ~root.

Fixes: <https://bugs.gnu.org/30728>
2018-03-29 07:03:37 +02:00