1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-06-20 12:44:04 +02:00
Commit Graph

73 Commits

Author SHA1 Message Date
Maxim Cournoyer f98c00ab74 machine: Dynamically retrieve the base server image name.
Query the API to find the latest Debian image to deploy the base system with.

* gnu/machine/hetzner/http.scm (null-or): New procedure.
(<hetzner-image>): New JSON record type.
(<hetzner-image-created-from>): Likewise.
(<hetzner-image-protection>): Likewise.
(%hetzner-default-server-image): Change simple variable to a memoized
procedure.
(hetzner-api-server-create): Adjust user accordingly.
(hetzner-api-images): New procedure.

Change-Id: I9544708c878971a2c776c80b9a4ee06078d5ce61
2026-05-23 13:29:15 +09:00
Maxim Cournoyer 3777bf133e machine: hetzner: Fix initial deploy when ssh-key is #f.
This fixes a regression introduced in commit a2ef2bcbfd ("machine: hetzner:
Allow connections using ssh-agent"), where having no ssh-key would cause the
early Hetzner provisioning to fail due to the lack of SSH authentication.

* gnu/machine/hetzner.scm (%hetzner-ssh-key-file): New parameter.
(<hetzner-configuration>) [ssh-public-key]: Compute default according to the
value of the private ssh-key field.  Introduce an indirection via...
(hetzner-configuration-ssh-public-key): ... this new procedure, to honor
%hetzner-ssh-key-file.
(hetzner-configuration-ssh-key): Likewise for the private ssh-key.
(hetzner-configuration-ssh-key-fingerprint): Rename to...
(public-key->fingerprint): ... this, taking just the public key as argument.
Update doc.
(hetzner-configuration-ssh-key-public): Rename to...
(public-key->string-with-type): ...this, for clarity, and accept just a
public-key object.  Update doc.
(hetzner-machine-ssh-key): Exit early with #f when no ssh key is provided.
(temporary-ssh-key-file): New procedure.
(hetzner-machine-ssh-key-create): Assert a public key is defined.  Adjust
calls to renamed procedures, and adjust for the `hetzner-api-server-create'
API change.
(hetzner-machine-enable-rescue-system): Refine doc and fix code path when
ssh-key is #f.
(hetzner-machine-rescue-install-os): Document.
(hetzner-machine-provision): Refine doc. Remove extraneous sleep and #:unwind
argument. Limit ssh-session dynamic scope to where it's needed.
(cleanup-temporary-ssh-key/maybe): New procedure.
(deploy-hetzner): Create and use a temporary SSH key when none is defined, and
clean it up when done or on errors.
* gnu/machine/hetzner/http.scm (hetzner-api-server-create): Make ssh-keys a
keyword argument, and fix execution when it's #f.
(hetzner-api-server-enable-rescue-system): Likewise.
* tests/machine/hetzner.scm ("deploy-machine-mock-with-unprovisioned-server"):
Adjust test.
* tests/machine/hetzner/http.scm (create-server)
("hetzner-api-server-create-unit")
("hetzner-api-server-enable-rescue-system-unit")
("hetzner-api-actions-integration")
("hetzner-api-server-enable-rescue-system-integration"): Likewise.
* doc/guix.texi (Invoking guix deploy): Precise what happens when 'ssh-key' is
 #f in hetzner-configuration, and suggest declaratively authorizing your SSH
key.

Change-Id: I812b348fb553f3b5aebd0bf66850c6ecb9e06653
2026-05-23 13:21:16 +09:00
Maxim Cournoyer 6e7d100ee3 machine: hetzner: Allow providing the SSH user.
* gnu/machine/hetzner.scm (<hetzner-configuration>)
[user]: New field.
(hetzner-machine-delegate): Use match-record to bind the field values; honor
user.
* doc/guix.texi (Invoking guix deploy): Document it.

Fixes: #8493
Change-Id: I026828c508ea936523fe864e2646ab9e3a1329c4
2026-05-23 13:21:16 +09:00
Maxim Cournoyer b5e047ff9b machine: hetzner: Introduce the `make-hetzner-os' procedure.
All the performance and general purpose newer x86 Hetzner server types like
the 'cpx22' now require an EFI bootloader, while older ones like the 'cx23'
still expect a BIOS bootloader.

Instead of exposing the user to errors when selecting the correct operating
system template to use, provide a procedure that takes returning one based on
the server type name.

* gnu/machine/hetzner.scm (%hetzner-os-arm): Rename to...
(%hetzner-os-arm/efi): ... this.  Adjust for variable name change.
(%hetzner-os-x86): Rename to...
(%hetzner-os-x86/bios): ... this.  Adjust for variable name change.
(%hetzner-os-x86/efi): New variable.
(server-type-name->arch, server-type-name->bootloader)
(make-hetzner-os): New procedures.
(%hetzner-os-x86, %hetzner-os-x86): Deprecate variables.
(hetzner-machine-bootstrap-os-form): Use the server type name to infer whether
the EFI or BIOS bootloader should be used, along the EFI partition.
* doc/guix.texi (Invoking guix deploy): Updated doc.

Fixes: #8523
Change-Id: I331a76e12bb3c19f5664dcbe4437a8d1cfe1d363
2026-05-19 14:15:27 +09:00
Maxim Cournoyer 54e92a3c05 machine: hetzner: Refine installation with bind mount in rescue.
This reverts commit 3e1befe1d8 ("machine: hetzner: Fix deployment."),
adopting a simpler/correct alternative.

* gnu/machine/hetzner.scm (hetzner-machine-rescue-install-os): Bind mount
/gnu, not /gnu/store.

Change-Id: I09ffb4db8a39b4bcd5e7645aee63427c6bc969a0
Suggested-by: Rutherther <rutherther@ditigal.xyz>
2026-05-11 20:31:36 +09:00
Sören Tempel 1d855b34f6 machine: hetzner: Use dhcpcd-service-type.
Guix 1.5.0 supports dhcpcd-service-type; therefore, (assuming hetzner
already has a Guix 1.5.0 image), it should no longer be necessary to
use dhcp-client-service-type here.  This is one of the few remaining
users of dhcp-client-service-type changing this here will allow to
remove this deprecated service in a future pull request.

* gnu/machine/hetzner.scm (hetzner-machine-bootstrap-os-form): Use
dhcpcd-service-type.

Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
2026-05-05 23:48:45 +09:00
Maxim Cournoyer 3b05b9d7ac machine: hetzner: Fix default value for hetzner-configuration-delete?
#f is to keep the failed provisioned server intact for debugging. The
documented default is #t, so adjust the code accordingly.

* gnu/machine/hetzner.scm (<hetzner-configuration>)
[delete?]: Change default to #t to match documentation.

Change-Id: Iabee105cbf5f5e31e8a8f5cb5db99439a168f174
2026-05-05 23:48:45 +09:00
Gábor Udvari 3e1befe1d8 machine: hetzner: Fix deployment.
* gnu/machine/hetzner.scm (hetzner)
[hetzner-machine-rescue-install-os]: Fix deployment.

Reported-by: Sylvain Bellemare (https://codeberg.org/gluonix)
Fixes: #6585
Change-Id: Ie16ee541ad5b81d5014b825ad0e35deddd2e497e
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
2026-05-05 23:48:44 +09:00
Ludovic Courtès 72e724cef4 services, tests: Refer to inherited field values where applicable.
* gnu/machine/hetzner.scm (operating-system-authorize): Refer to ‘services’
instead of calling ‘operating-system-user-services’.
* gnu/services/virtualization.scm (secret-service-operating-system): Likewise.
* gnu/tests.scm (operating-system-with-console-syslog): Likewise.
* gnu/tests/avahi.scm (%avahi-os): Likewise.
* gnu/tests/base.scm (%test-guix-daemon-unprivileged): Likewise.
* gnu/tests/nfs.scm (%nfs-os): Likewise.
(run-nfs-full-test): Likewise.
* gnu/system/vm.scm (virtualized-operating-system): Refer to ‘initrd-modules’
instead of calling ‘operating-system-initrd-modules’.

Change-Id: I00c5f5c1e171b174bf0ca709b2dbd13a2fe161b5
2026-03-20 13:27:16 +01:00
Ashish SHUKLA 5e63c9bdb1 gnu: hetzner: Fix deploy on hetzner
* gnu/machine/hetzner.scm (hetzner-machine-rescue-install-packages): Install
uidmap package too.

Change-Id: I86f638bc65d42cb4e26381cd91140cd92bc90b18
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-11-24 23:22:52 +01:00
Remco van 't Veer f1f9849c01 machine: hetzner: Fix install OS.
Debian no longer ships guix package.

* gnu/machine/hetzner.scm (hetzner-machine-rescue-install-os): Use
guix-install.sh.

Change-Id: I8344d5877057181235c233d9f6f745507af30b85
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-14 16:35:55 +02:00
Zheng Junjie b8c464af7b machine: hetzner: Fix machine bootstrap.
* gnu/machine/hetzner.scm (hetzner-machine-bootstrap-os-form): Use
dhcp-client-service-type here.

Change-Id: I4a3fd4ac598ea0b19cc81146de1f07fa256199b7
Signed-off-by: Hilton Chain <hako@ultrarare.space>
2025-06-26 20:43:55 +08:00
Owen T. Heisler 6ae4a7319f machine: hetzner: Use dhcpcd service instead of dhcp-client.
This fixes DHCP-provided routes on servers that have both public and private
interfaces.

* gnu/machine/hetzner.scm (%hetzner-os-arm)[services]: Replace
dhcp-client-service-type with dhcpcd-service-type.

Fixes: https://codeberg.org/guix/guix/issues/407
Change-Id: I8e0b4fb12727e784f2b622273ffef504e58eddfe
Signed-off-by: Hilton Chain <hako@ultrarare.space>
2025-06-09 00:08:04 +08:00
Sergey Trofimov 60f8d67480 machine: ssh: Use store-parameterize in a monad.
* gnu/machine/ssh (deploy-managed-host): Use store-parameterize in
monadic context.

Change-Id: I6441a5dac856633f2c2a00b77f21a385bf3a9510
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-06-06 18:43:25 +02:00
Sergey Trofimov 7a4193ec4a machine: hetzner: Allow attaching existing public IPs.
* gnu/machine/hetzner.scm (hetzner-configuration): Add ipv4 and ipv6
fields. Export accessors.
* gnu/machine/hetzner/http.scm (hetnzer-api-primary-ips): New function.
(<hetzner-primary-ip>): New json mapping.
(hetzner-api-server-create): Pass IP addresses in request.
* doc/guix.texi (Invoking guix deploy): Document it.

Change-Id: I44509cc98e041762dc483e876566e79bde85b26a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-04-21 23:55:50 +02:00
Sergey Trofimov a2ef2bcbfd machine: hetzner: Allow connections using ssh-agent.
* gnu/machine/hetzner.scm (<hetzner-configuration>): Add ssh-public-key.
* doc/guix.texi (System Configuration)[hetzner-configuration]: Document it.

Change-Id: I7354ead508b1a4819534c6b22ba1f089749927c2
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Modified-by: Ludovic Courtès <ludo@gnu.org>
2025-04-06 11:45:18 +02:00
Roman Scherer 2e8439d37e machine: hetzner: Fix deployment on smaller instances.
* gnu/machine/hetzner.scm (hetzner-machine-rescue-install-os): Avoid out of
disk space error by bind mounting /mnt/tmp/gnu/store to /gnu/store.
* tests/machine/hetzner.scm: Test with smaller instances.
* doc/guix.texi (Invoking guix deploy): Mention unsupported instance.

Change-Id: If8bfb6733de493b51813b3e82e255849192f7cba
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 23:03:36 +01:00
Arun Isaac 55a5181e74 machine: ssh: Return monadic value from roll-back-managed-host.
Previously, <unspecified> would be returned. That was a bug. Monadic
procedures must always return monadic values.

* gnu/machine/ssh.scm (roll-back-managed-host): Return monadic value.

Change-Id: I3db2879dbfbcab5e9d251fa5ed02c8653adbeafb
2025-02-27 22:52:27 +00:00
Efraim Flashner 66daf46b41 gnu: Fix some misspellings.
Change-Id: I316652aff7418af4b8e83bea24638b1513f8aa97
2025-02-19 11:21:47 +02:00
Roman Scherer 0753a17ddf machine: Implement 'hetzner-environment-type'.
* Makefile.am (SCM_TESTS): Add test modules.
* doc/guix.texi: Add documentation.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add modules.
* gnu/machine/hetzner.scm: Add hetzner-environment-type.
* gnu/machine/hetzner/http.scm: Add HTTP API.
* po/guix/POTFILES.in: Add Hetzner modules.
* tests/machine/hetzner.scm: Add machine tests.
* tests/machine/hetzner/http.scm Add HTTP API tests.

Change-Id: I276ed5afed676bbccc6c852c56ee4db57ce3c1ea
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-09 18:20:42 +01:00
Ludovic Courtès 1305f78d05 reconfigure: Support loading the system for kexec reboot.
This allows rebooting straight into the new system with ‘reboot -k’.

* guix/scripts/system/reconfigure.scm (kexec-loading-program)
(load-system-for-kexec): New procedures.
* gnu/tests/reconfigure.scm (run-kexec-test): New procedure.
(%test-upgrade-kexec): New variable.
* guix/scripts/system.scm (perform-action): Add #:load-for-kexec?.
Call ‘load-system-for-kexec’.
(show-help, %options): Add ‘--no-kexec’.
(%default-options): Add ‘load-for-kexec?’.
(process-action): Honor it and pass it to ‘perform-action’.
* gnu/machine/ssh.scm (deploy-managed-host): Add call to
‘load-system-for-kexec’.
* doc/guix.texi (Invoking guix system): Document it.

Change-Id: I86d11f1c348e4359bc9e73c86e5aebff60fe875c
2024-12-28 22:47:34 +01:00
Tobias Geerinckx-Rice 902b15b24d gnu: Replace (almost) all uses of /run/setuid-programs.
…those good for master, anyway.

* gnu/packages/admin.scm (ktsuss, opendoas, hosts)
[arguments]: Replace /run/setuid-programs with /run/privileged/bin.
* gnu/packages/containers.scm (slirp4netns)[arguments]: Likewise.
* gnu/packages/debian.scm (pbuilder)[arguments]: Likewise.
* gnu/packages/disk.scm (udevil)[arguments]: Likewise.
* gnu/packages/enlightenment.scm (efl, enlightenment)
[arguments]: Likewise.
* gnu/packages/gnome.scm (gdm, gnome-control-center)
[arguments]: Likewise.
* gnu/packages/linux.scm (singularity)[arguments]: Likewise.
* gnu/packages/lxde.scm (spacefm)[arguments]: Likewise.
* gnu/packages/monitoring.scm (zabbix-agentd)[arguments]: Likewise.
* gnu/packages/virtualization.scm (ganeti)[arguments]: Likewise.
* gnu/packages/xdisorg.scm (xsecurelock)[arguments]: Likewise.
* gnu/services/dbus.scm (dbus-configuration-directory): Likewise.
* gnu/services/ganeti.scm (%default-ganeti-environment-variables):
Likewise.
* gnu/services/monitoring.scm (zabbix-agent-shepherd-service): Likewise.
* gnu/tests/ldap.scm (marionette): Likewise.
* gnu/tests/monitoring.scm (os): Likewise.
2024-08-11 02:00:00 +02:00
Richard Sent 3e87b207ce file-systems: Add support for mounting CIFS file systems
* gnu/build/file-systems (canonicalize-device-name): Do not attempt to resolve
CIFS formatted device specifications.
(mount-file-systems): Add mount-cifs nested function.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Skip checking
for CIFS availability, similar to NFS.
* guix/scripts/system.scm (check-file-system-availability): Likewise.

Change-Id: I182e290eba64bbe5d1332815eb93bb68c01e0c3c
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-06-04 12:08:34 +02:00
Ricardo Wurmus 9ce548a26e machine/ssh: Refresh parameterization of %CURRENT-SYSTEM.
When using "guix deploy" on an x86_64-linux machine to deploy a system to
i686-linux, DEPLOY-MANAGED-HOST would revert %CURRENT-SYSTEM to the host
system's value by the time it evaluated UPGRADE-SHEPHERD-SERVICES.  The
earlier PARAMETERIZE would no longer be effective.

* gnu/machine/ssh.scm (deploy-managed-host): Ensure that
UPGRADE-SHEPHERD-SERVICES is evaluated for the architecture of the target
machine.

Change-Id: I0816da79cd7c46a69418717fa33b2fe4e2fabae0
2024-02-19 11:21:27 +01:00
Ludovic Courtès 5652c2e147 system: Do not check initrd modules for pseudo file systems.
Reported by hako on #guix.

* gnu/machine/ssh.scm (machine-check-initrd-modules): Filter out pseudo
file systems from 'file-systems'.
* guix/scripts/system.scm (check-initrd-modules): Likewise.
2023-08-08 18:01:54 +02:00
Ludovic Courtès 17b01d5463 machine: ssh: Validate 'system' field.
* gnu/machine/ssh.scm (<machine-ssh-configuration>)[system]: Add
'sanitize' property.
(validate-system-type): New macro.
2022-11-17 22:27:39 +01:00
Ricardo Wurmus 8d7cb7f2a4 machine/digital-ocean: Pull operating system definition out of string.
* gnu/machine/digital-ocean.scm (guix-infect): Define the operating system
declaration as an s-expression and paste it into the generated Bash script to
simplify editing.
2022-11-09 13:45:24 +01:00
Ricardo Wurmus ebb88e2bed machine/digital-ocean: Set load path to Guile 3.0 directories.
* gnu/machine/digital-ocean.scm (guix-infect, add-static-networking): Set
GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH to directories for Guile 3.0
instead of 2.2.
2022-11-09 13:45:24 +01:00
Ricardo Wurmus e8dcd008a0 machine/digital-ocean: Use static-networking-service-type.
* gnu/machine/digital-ocean.scm (ip+netmask->cidr): New procedure.
(guix-infect, add-static-networking): Use static-networking-service-type
instead of the deprecated static-networking-service.
2022-11-09 13:45:24 +01:00
Ricardo Wurmus c8e41af7be machine/digital-ocean: Use nightly Guix.
* gnu/machine/digital-ocean.scm (guix-infect): Fetch latest Guix build from
ci.guix.gnu.org.
2022-11-09 13:45:24 +01:00
Julien Lepiller 82b0f3755d guix: Fix typos.
These typos were found and reported through weblate.

* gnu/packages/audio.scm (wildmidi)[description]: Fix typo.
* gnu/packages/games.scm (cgoban)[description]: Fix typo.
* gnu/services/version-control.scm (gitolite-service-type)[description]:
  Fix typo.
* gnu/installer/newt/substitutes.scm (run-substitutes-page): Remove full
  stop at end of title.
* gnu/machine/ssh.scm (machine-ssh-configuration-system): Move
  punctuation outside of quotes.
* guix/scripts/home.scm (process-action): Remove trailing space before
  newline.
* guix/scripts/system.scm (show-help): Fix typo.
* guix/scripts/environment.scm (with-store/maybe): Fix typo.
2022-10-17 07:29:09 +02:00
Ludovic Courtès 1033645e9d machine: ssh: Parameterize '%current-system' early on.
Fixes <https://issues.guix.gnu.org/58084>.
Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>.

Previously, "sanity checks" and other operations would happen in a
context where '%current-system' has its default value.  Thus, running
'guix deploy' on x86_64-linux machine for an aarch64-linux one would
lead things like '%base-initrd-modules' to see "x86_64-linux" as the
'%current-system' value, in turn making the wrong choices.

* gnu/machine/ssh.scm (check-deployment-sanity)[assertions]: Wrap in
'parameterize'.
(deploy-managed-host): Likewise for the 'mlet' body.
2022-09-26 23:29:35 +02:00
Matthew James Kraai a451a809d5 Fix misspelling of GUIX_DIGITAL_OCEAN_TOKEN.
* gnu/machine/digital-ocean.scm (maybe-raise-missing-api-key-error): Fix
  misspelling of GUIX_DIGITAL_OCEAN_TOKEN.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2022-09-04 17:57:02 +02:00
Maxim Cournoyer 0dc019e19a initrd: Use non-hyphenated kernel command-line parameter names.
This is to make it less surprising, given the common convention sets forth by
the kernel Linux command-line parameters.

* gnu/build/linux-boot.scm (boot-system): Rename '--load', '--repl', '--root'
and '--system' to 'gnu.load', 'gnu.repl', 'root' and 'gnu.system',
respectively.  Adjust doc.
(find-long-option): Adjust doc.
* gnu/installer/parted.scm (installer-root-partition-path): Adjust accordingly.
* gnu/system.scm (bootable-kernel-arguments): Add a VERSION argument and
update doc.  Use VERSION to conditionally return old style vs new style initrd
arguments.
(%boot-parameters-version): Increment to 1.
(operating-system-boot-parameters): Adjust doc.
(operating-system-boot-parameters-file): Likewise.
* gnu/system/linux-initrd.scm (raw-initrd, base-initrd): Likewise.
* doc/guix.texi: Adjust doc.
* gnu/build/activation.scm (boot-time-system): Adjust accordingly.
* gnu/build/hurd-boot.scm (boot-hurd-system): Likewise.
* gnu/packages/commencement.scm (%final-inputs-riscv64): Adjust comment.
2022-03-01 10:30:17 -05:00
Ludovic Courtès 084b76a70a machine: ssh: Add 'safety-checks?' field.
Fixes <https://issues.guix.gnu.org/52766>.
Reported by Michael Rohleder <mike@rohleder.de>.

* gnu/machine/ssh.scm (<machine-ssh-configuration>)[safety-checks?]: New
field.
(machine-check-file-system-availability): Return the empty list when
'safety-checks?' is false.
(machine-check-initrd-modules): Likewise.
* doc/guix.texi (Invoking guix deploy): Document it.
2022-01-16 23:56:55 +01:00
Ludovic Courtès 7f20e59a13 machine: ssh: Open a single SSH session per machine.
Previously, any call to 'managed-host-remote-eval' and similar would
open a new SSH session to the host.  With this change, an SSH session is
opened once, cached, and then reused by all subsequent calls to
'machine-ssh-session'.

* gnu/machine/ssh.scm (<machine-ssh-configuration>): Add
'this-machine-ssh-configuration'.
[session]: Mark as thunked and change default value to an
'open-machine-ssh-session*' call.
(open-machine-ssh-session, open-machine-ssh-session*): New procedures.
(machine-ssh-session): Replace inline code by call to
'open-machine-ssh-session'.
2022-01-09 23:17:17 +01:00
Maxim Cournoyer da4e409483 Migrate to the new 'targets' field of bootloader-configuration.
The old 'target' field is deprecated; adjust the sources to use the new
'targets' one instead.

* doc/guix-cookbook.texi<target>: Replace by 'targets'.
* gnu/bootloader/grub.scm: Likewise.
* gnu/installer/parted.scm: Likewise.
* gnu/machine/digital-ocean.scm: Likewise.
* gnu/system/examples/asus-c201.tmpl: Likewise
* gnu/system/examples/bare-bones.tmpl: Likewise
* gnu/system/examples/bare-hurd.tmpl: Likewise
* gnu/system/examples/beaglebone-black.tmpl: Likewise
* gnu/system/examples/desktop.tmpl: Likewise
* gnu/system/examples/docker-image.tmpl: Likewise
* gnu/system/examples/lightweight-desktop.tmpl: Likewise
* gnu/system/examples/vm-image.tmpl: Likewise
* gnu/system/examples/yggdrasil.tmpl: Likewise
* gnu/system/hurd.scm: Likewise
* gnu/system/images/hurd.scm: Likewise
* gnu/system/images/novena.scm: Likewise
* gnu/system/images/pine64.scm: Likewise
* gnu/system/images/pinebook-pro.scm: Likewise
* gnu/system/images/rock64.scm: Likewise
* gnu/system/install.scm: Likewise
* gnu/system/vm.scm: Likewise
* gnu/tests.scm: Likewise
* gnu/tests/ganeti.scm: Likewise
* gnu/tests/install.scm: Likewise
* gnu/tests/nfs.scm: Likewise
* gnu/tests/telephony.scm: Likewise
* tests/boot-parameters.scm: Likewise
* tests/system.scm: Likewise
2021-08-29 01:05:26 -04:00
Brice Waegeneire ef3f38ea00 services: openssh: Replace 'without-password' by 'prohibit-password'.
For some time, OpenSSH's option 'PermitRootLogin' has deprecated the
ambiguous argument 'without-password' with 'prohibit-password'.

* doc/guix.texi (Network Services): Replace 'without-password by
'prohibit-password.
* gnu/machine/digital-ocean.scm (guix-infect): Change system
configuration to use 'prohibit-password.
* gnu/services/ssh.scm (openssh-configuration): Change comment to use
'prohibit-password.
(openssh-config-file): Add support for 'prohibit-password to
'permit-root-login'.  Warn about deprecated 'without-password usage.
* gnu/tests/ganeti.scm (%ganeti-os): Replace 'without-password by
'prohibit-password.

Signed-off-by: Tobias Geerinckx-Rice <me@tobias.gr>
2021-06-20 16:44:08 +02:00
Ludovic Courtès fe509e017f machine: ssh: Respect calling convention for monadic procedures.
Fixes a regression introduced in
2885c3568e.

Reported by Mathieu Othacehe.

* gnu/machine/ssh.scm (deploy-managed-host)[eval/error-handling]: Return
two values in the standard case.
2021-06-03 13:04:20 +02:00
Ludovic Courtès 2885c3568e machine: ssh: Gracefully handle failure of the effectful bits.
Previously, '&inferior-exception' raised by 'upgrade-shepherd-services'
and co. would go through as-is, leaving users with an ugly backtrace.

* gnu/machine/ssh.scm (deploy-managed-host): Define
'eval/error-handling' and use it in lieu of EVAL as arguments to
'switch-to-system', 'upgrade-shepherd-services', and
'install-bootloader'.
2021-06-01 23:26:07 +02:00
Ludovic Courtès 120051e1b9 machine: ssh: Use 'formatted-message'.
* gnu/machine/ssh.scm (machine-check-initrd-modules): Use
'formatted-message' instead of 'format' + '&message'.
2021-02-25 11:29:35 +01:00
Ludovic Courtès 61d8bd56a4 machine: ssh: Do not import the host (guix config), really.
This is a followup to 70ffa8af1e, which
did not really solve the problem.

* gnu/machine/ssh.scm (not-config?): New procedure.
(machine-boot-parameters): Use it as an argument to
'source-module-closure'.
2021-01-04 11:51:48 +01:00
Miguel Ángel Arruga Vivas f00e68ace0 system: Allow separated /boot and encrypted root.
* gnu/bootloader/grub.scm (grub-configuration-file): New parameter
store-crypto-devices.
[crypto-devices]: New helper function.
[builder]: Use crypto-devices.
* gnu/machine/ssh.scm (roll-back-managed-host): Use
boot-parameters-store-crypto-devices to provide its contents to the
bootloader configuration generation process.
* gnu/tests/install.scm (%encrypted-root-not-boot-os,
%encrypted-root-not-boot-os): New os declaration.
(%encrypted-root-not-boot-installation-script): New script, whose contents
were initially taken from %encrypted-root-installation-script.
(%test-encrypted-root-not-boot-os): New test.
* gnu/system.scm (define-module): Export
operating-system-bootoader-crypto-devices and
boot-parameters-store-crypto-devices.
(<boot-parameters>): Add field store-crypto-devices.
(read-boot-parameters): Parse store-crypto-devices field.
[uuid-sexp->uuid]: New helper function extracted from
device-sexp->device.
(operating-system-bootloader-crypto-devices): New function.
(operating-system-bootcfg): Use
operating-system-bootloader-crypto-devices to provide its contents to
the bootloader configuration generation process.
(operating-system-boot-parameters): Add store-crypto-devices to the
generated boot-parameters.
(operating-system-boot-parameters-file): Likewise to the file with
the serialized structure.
* guix/scripts/system.scm (reinstall-bootloader): Use
boot-parameters-store-crypto-devices to provide its contents to the
bootloader configuration generation process.
* tests/boot-parameters.scm (%default-store-crypto-devices): New
variable.
(%grub-boot-parameters, test-read-boot-parameters): Use
%default-store-crypto-devices.
(tests store-crypto-devices): New tests.
2020-12-21 18:41:11 +01:00
Ludovic Courtès 70ffa8af1e machine: ssh: Do not import the host (guix config).
* gnu/machine/ssh.scm (machine-boot-parameters): Use 'make-config.scm'
for (guix config).
2020-11-09 23:27:09 +01:00
Miguel Ángel Arruga Vivas 582cf9257c system: Add store-directory-prefix to boot-parameters.
Fixes <http://issues.guix.gnu.org/44196>

* gnu/machine/ssh.scm (roll-back-managed-host): Use
boot-parameters-store-directory-prefix.
* gnu/system.scm (define-module): Export
boot-parameters-store-directory-prefix.
(<boot-parameters>)[store-directory-prefix]: New field. It is used to
generate the correct paths when /gnu/store is installed on a btrfs
subvolume whose name doesn't match the final runtime path, as the
bootloader doesn't have knowledge about the final mounting points.
[boot-parameters-store-directory-prefix]: New accessor.
(read-boot-parameters): Read directory-prefix from store field.
(operating-system-boot-parameters-file): Add directory-prefix to
store field.
* guix/scripts/system.scm (reinstall-bootloader): Use
boot-parameters-store-directory-prefix.
* test/boot-parameters.scm (%default-btrfs-subvolume,
%default-store-directory-prefix): New variables.
(%grub-boot-parameters): Use %default-store-directory-prefix.
(%default-operating-system): Use %default-btrfs-subvolume.
(test-boot-parameters): Add directory-prefix.
(test optional fields): Add test for directory-prefix.
(test os store-directory-prefix): New test.
2020-11-01 02:28:38 +01:00
Miguel Ángel Arruga Vivas eaf0963983 system: Provide locale information to the bootloader.
* gnu/machine/ssh.scm (roll-back-managed-host): Use locale information
from boot-parameters.
* gnu/system.scm (operating-system-bootcfg): Provide locale information
to the bootloader.
* guix/system/script.scm (reinstall-bootloader): Use locale information
from boot-parameters.
2020-10-18 15:33:05 +02:00
Stefan 1c3b709edb linux-boot: Handle nfs-root device strings.
* gnu/build/linux-boot.scm (device-string->file-system-device): Support
nfs-root "device" strings.
* gnu/build/file-systems.scm (canonicalize-device-spec): Support nfs-root
"device" strings.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Avoid
checking of NFS file systems.
* gnu/system.scm (read-boot-parameters, device-sexp->device): Support
nfs-root "device" strings.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
2020-09-07 11:00:48 +02:00
Mathieu Othacehe dac7dd1b0b Remove "guile-zlib" extension when unused.
This is a follow-up of 755f365b02.

As (zlib) is autoloaded in (gnu build linux-modules), "guile-zlib" is needed
as an extension only when it is effectively used.

* gnu/installer.scm (installer-program): Remove "guile-zlib" from the extensions.
* gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto.
* gnu/services.scm (activation-script): Ditto.
* gnu/services/base.scm (default-serial-port): Ditto,
(agetty-shepherd-service): ditto,
(udev-service-type): ditto.
* gnu/system/image.scm (gcrypt-sqlite3&co): Ditto.
* gnu/system/shadow.scm (account-shepherd-service): Ditto.
2020-08-25 12:39:11 +02:00
Mathieu Othacehe 755f365b02 linux-libre: Support module compression.
This commit adds support for GZIP compression for linux-libre kernel
modules. The initrd modules are kept uncompressed as the initrd is already
compressed as a whole.

The linux-libre kernel also supports XZ compression, but as Guix does not have
any available bindings for now, and the compression time is far more
significant, GZIP seems to be a better option.

* gnu/build/linux-modules.scm (modinfo-section-contents): Use
'call-with-gzip-input-port' to read from a module file using '.gz' extension,
(strip-extension): new procedure,
(dot-ko): adapt to support compression,
(ensure-dot-ko): ditto,
(file-name->module-name): ditto,
(find-module-file): ditto,
(load-linux-module*): ditto,
(module-name->file-name/guess): ditto,
(module-name-lookup): ditto,
(write-module-name-database): ditto,
(write-module-alias-database): ditto,
(write-module-device-database): ditto.
* gnu/installer.scm (installer-program): Add "guile-zlib" to the extensions.
* gnu/machine/ssh.scm (machine-check-initrd-modules): Ditto.
* gnu/services.scm (activation-script): Ditto.
* gnu/services/base.scm (default-serial-port): Ditto,
(agetty-shepherd-service): ditto,
(udev-service-type): ditto.
* gnu/system/image.scm (gcrypt-sqlite3&co): Ditto.
* gnu/system/linux-initrd.scm (flat-linux-module-directory): Add "guile-zlib"
to the extensions and make sure that the initrd only contains
uncompressed module files.
* gnu/system/shadow.scm (account-shepherd-service): Add "guile-zlib" to the
extensions.
* guix/profiles.scm (linux-module-database): Ditto.
2020-08-25 11:53:20 +02:00
Ludovic Courtès a396dd01bc machine: ssh: Check for potential system downgrades.
This is a followup to 8e31736b0a.

* guix/scripts/system/reconfigure.scm (check-forward-update): Add
 #:current-channels.  Use it instead of OLD.
* gnu/services.scm (sexp->system-provenance): New procedure.
(system-provenance): Use it.
* gnu/machine/ssh.scm (<machine-ssh-configuration>)[allow-downgrades?]:
New field.
(machine-check-forward-update): New procedure.
(check-deployment-sanity)[assertions]: Call it.
* doc/guix.texi (Invoking guix deploy): Document 'allow-downgrades?'
field.
2020-07-27 12:06:35 +02:00