From 9f434b57b7fc477894e52c47a6cf565da3b43b2d Mon Sep 17 00:00:00 2001 From: Dan Rostovtsev Date: Sun, 15 Mar 2026 19:10:43 -0400 Subject: Added instructions for deploying machine configurations. --- doc/examples/cloud-guix.scm | 49 ---------------------------------------- doc/examples/guix-on-linode.scm | 50 +++++++++++++++++++++++++++++++++++++++++ doc/guix-cookbook.texi | 18 +++++++++++---- 3 files changed, 64 insertions(+), 53 deletions(-) delete mode 100644 doc/examples/cloud-guix.scm create mode 100644 doc/examples/guix-on-linode.scm diff --git a/doc/examples/cloud-guix.scm b/doc/examples/cloud-guix.scm deleted file mode 100644 index 3d4bde024fd..00000000000 --- a/doc/examples/cloud-guix.scm +++ /dev/null @@ -1,49 +0,0 @@ -;; Most cloud service providers use qemu / cloud-init to run images inside -;; inside of a virtual machine. This example was written for the "linode" -;; tutorial originally, but it should apply to other cloud services as well. - -(use-modules (gnu) - (guix modules)) -(use-service-modules networking - ssh) -(use-package-modules admin - package-management - ssh - tls) - -;; if you want to add new packages, services and users later, you can -;; use "guix deploy" -(operating-system - (host-name "localhost") - (timezone "UTC") - (locale "en_US.UTF-8") - - (bootloader (bootloader-configuration (bootloader grub-bootloader))) - - ;; we configure our bootable guix system to be on device "/dev/sda" - ;; if you want to use a different device, change it here - (file-systems (cons (file-system - (device "/dev/sda") - (mount-point "/") - (type "ext4")) - %base-file-systems)) - - - ;; our swap is assumed to be /dev/sdb. - ;; if your vm will have a different swap device, change it here - (swap-devices (list "/dev/sdb")) - - (initrd-modules (cons "virtio_scsi" ; Needed to find the disk - %base-initrd-modules)) - - (packages (cons* %base-packages)) - - (services (cons* - (service dhcp-client-service-type) - (service openssh-service-type - (openssh-configuration - (password-authentication? #f) - (permit-root-login 'prohibit-password) - (authorized-keys - `(("root" ,(local-file "/path/to/key.pub")))))) - %base-services))) diff --git a/doc/examples/guix-on-linode.scm b/doc/examples/guix-on-linode.scm new file mode 100644 index 00000000000..56acf53b640 --- /dev/null +++ b/doc/examples/guix-on-linode.scm @@ -0,0 +1,50 @@ +;; Most cloud service providers use qemu / cloud-init to run images inside +;; inside of a virtual machine. This example was written for the "linode" +;; tutorial originally, but it should apply similarly other cloud services +;; as well. + +(use-modules (gnu) + (guix modules)) +(use-service-modules networking + ssh) +(use-package-modules admin + package-management + ssh + tls) + +;; if you want to add new packages, services and users later, you can +;; use "guix deploy" +(operating-system + (host-name "localhost") + (timezone "UTC") + (locale "en_US.UTF-8") + + (bootloader (bootloader-configuration (bootloader grub-bootloader))) + + ;; we configure our bootable guix system to be on device "/dev/sda" + ;; if you want to use a different device, change it here + (file-systems (cons (file-system + (device "/dev/sda") + (mount-point "/") + (type "ext4")) + %base-file-systems)) + + + ;; our swap is assumed to be /dev/sdb. + ;; if your vm will have a different swap device, change it here + (swap-devices (list "/dev/sdb")) + + (initrd-modules (cons "virtio_scsi" ; Needed to find the disk + %base-initrd-modules)) + + (packages (cons* %base-packages)) + + (services (cons* + (service dhcp-client-service-type) + (service openssh-service-type + (openssh-configuration + (password-authentication? #f) + (permit-root-login 'prohibit-password) + (authorized-keys + `(("root" ,(local-file "/path/to/key.pub")))))) + %base-services))) diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi index 4256957d3cf..4668de11fc4 100644 --- a/doc/guix-cookbook.texi +++ b/doc/guix-cookbook.texi @@ -3011,18 +3011,18 @@ system init} to initialize the guix installation. Replace the authorized keys with the path to your keys. @lisp -@include examples/cloud-guix.scm +@include examples/guix-on-linode.scm @end lisp Copy this to your linode in whatever directory you choose. In this -example, we choose to call the file @file{cloud-guix.scm} and save it -to @file{/tmp/cloud-guix.scm}. +example, we choose to call the file @file{guix-on-linode.scm} and save it +to @file{/tmp/guix-on-linode.scm}. Now we are ready to install a guix system realizing this config to @file{/mnt/guix}. @example -guix system init /tmp/cloud-guix.scm /mnt/guix +guix system init /tmp/guix-on-linode.scm /mnt/guix @end example @subsection Configure Linode to Boot from Guix Image @@ -3093,6 +3093,16 @@ Note that your coordinator machine will have to generate a public key, which will be stored in @file{/etc/guix}. Copy that over to the target machine and authorize it before running the deployment. +If at the last step you are having issues with the authorization after running + +@example +# guix archive --authorize < coordinator-key.pub +@end example + +Then you likely have to add the key to the authorized keys in the herd +service definition. For details, see +@pxref{Getting Substitutes from Other Servers,,, guix, GNU Guix}. + @subsection Notes Here are some other approaches that may work as well. -- cgit v1.3