User Tools

Site Tools


manuals:distributions:guix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
manuals:distributions:guix [2026/08/16 18:56] – Polish documentation, localize examples and explain the one-week VPS trial aithermanuals:distributions:guix [2026/08/19 14:43] (current) – Update Guix platform inheritance and deployment examples aither
Line 1: Line 1:
-<page>navody:distribuce:guix</page>+<page>manuals:distributions:guix</page>
  
 <kb-managed <kb-managed
-  source="https://github.com/vpsfreecz/vpsfree-kb-contracts/blob/master/contract/pages/manuals-distributions-guix.txt" +  source="contract/pages/manuals-distributions-guix.txt" 
-  test="https://github.com/vpsfreecz/vpsfree-kb-contracts/blob/master/tests/suite/kb/guix.nix"+  test="kb/guix#*"
 /> />
  
Line 20: Line 20:
   * ''/etc/config/vpsadminos.scm'' makes Guix work inside a vpsAdminOS container.   * ''/etc/config/vpsadminos.scm'' makes Guix work inside a vpsAdminOS container.
  
-''system.scm'' loads the ''vpsadminos'' module from the second file. Keep this +''system.scm'' resolves ''%ct-operating-system-base'' from the ''vpsadminos'' 
-connectionit defines the container bootloader, file systems, and the service +module and inherits it. Keep the module lookup and inheritancethe platform 
-which applies the network configuration generated by vpsAdminOS during boot. +base provides the container bootloader, file systems, kernel placeholder, 
-The current versions of both files are available in the+packages, services, and network integration. The current versions of both files 
 +are available in the
 [[https://github.com/vpsfreecz/vpsadminos/tree/staging/image-scripts/images/guix|Guix template sources]]. [[https://github.com/vpsfreecz/vpsadminos/tree/staging/image-scripts/images/guix|Guix template sources]].
  
Line 31: Line 32:
 ===== Editing the configuration ===== ===== Editing the configuration =====
  
-Start by editing ''/etc/config/system.scm''You can change the host name, +Start by editing ''/etc/config/system.scm''The host name, timezone, and locale 
-packages, and services, for example. Keep ''%ct-services'', +are visible there as defaults that you can change. You can also add fields such 
-''%ct-file-systems'', and ''%ct-bootloader'' from the ''vpsadminos'' module.+as ''packages''which Guix evaluates directly. Keep the ''platform-system'' 
 +lookup and ''(inherit platform-system)'' so the platform-specific settings 
 +remain active. 
 + 
 +When changing servicesfirst derive and bind the service list outside the 
 +''operating-system'' record, then assign that binding to the ''services'' field. 
 +The deployment example below follows this pattern. Guix evaluates service 
 +fields after loading the configuration, so they must not depend on bindings 
 +from its temporary configuration module.
  
 Activate the configuration as ''root'': Activate the configuration as ''root'':
Line 109: Line 118:
 ;; Load the maintained vpsAdminOS container integration. ;; Load the maintained vpsAdminOS container integration.
 (add-to-load-path "/etc/config") (add-to-load-path "/etc/config")
-(use-modules (vpsadminos) +(use-modules (gnu)
-             (gnu)+
              (gnu machine)              (gnu machine)
              (gnu machine ssh)              (gnu machine ssh)
              (gnu services base))              (gnu services base))
-(use-package-modules nss ssh) 
 (use-service-modules ssh) (use-service-modules ssh)
  
-;; These files belong to the machine from which you run guix deploy. +(let* ((platform-system 
-(define %controller-signing-key +        (module-ref (resolve-interface '(vpsadminos)) 
-  (local-file "/etc/guix/signing-key.pub")) +                    '%ct-operating-system-base)) 
-(define %root-ssh-key +       ;; These files belong to the machine from which you run guix deploy. 
-  (local-file "/root/.ssh/id_ed25519.pub")) +       (controller-signing-key 
- +        (local-file "/etc/guix/signing-key.pub")) 
-(define %system +       (root-ssh-key 
-  (operating-system +        (local-file "/root/.ssh/id_ed25519.pub")) 
-    (host-name "guix-target") +       ;; Build the service list before assigning the delayed services field. 
-    (timezone "Etc/UTC"+       (user-services 
-    (locale "en_US.utf8"+        (cons 
-    (firmware '()) +         (simple-service 'controller-signing-key 
-    (initrd-modules '()) +                         guix-service-type 
-    (kernel %ct-dummy-kernel) +                         (guix-extension 
- +                          (authorized-keys 
-    (packages (cons* nss-certs +                           (list controller-signing-key)))) 
-                     %base-packages)) +         (modify-services 
- +             (operating-system-user-services platform-system) 
-    (essential-services +           (openssh-service-type config => 
-     (modify-services +             (openssh-configuration 
-         (operating-system-default-essential-services this-operating-system) +              (inherit config
-       (delete firmware-service-type) +              (permit-root-login 'prohibit-password) 
-       (delete (service-kind %linux-bare-metal-service)))) +              (password-authentication? #f) 
- +              (authorized-keys 
-    (bootloader %ct-bootloader) +               `(("root" ,root-ssh-key)))))))) 
-    (file-systems %ct-file-systems) +       (system 
- +        (operating-system 
-    (services +          (inherit platform-system) 
-     (cons* (service openssh-service-type +          (host-name "guix-target") 
-                     (openssh-configuration +          (timezone "Etc/UTC") 
-                      (openssh openssh-sans-x+          (locale "en_US.utf8"
-                      (permit-root-login 'prohibit-password) +          (services user-services))) 
-                      (password-authentication? #f) +       (target-machine 
-                      (authorized-keys +        (machine 
-                       `(("root" ,%root-ssh-key))))) +          (operating-system system) 
-            (simple-service 'controller-signing-key +          (environment managed-host-environment-type) 
-                            guix-service-type +          (configuration 
-                            (guix-extension +           (machine-ssh-configuration 
-                             (authorized-keys +            ;; Replace the address and host key with those of your target VPS. 
-                              (list %controller-signing-key)))) +            (host-name "192.0.2.3"
-            %ct-services)))+            (system "x86_64-linux"
- +            (user "root"
-(define %machine +            (identity "/root/.ssh/id_ed25519"
-  (machine +            (host-key "ssh-ed25519 REPLACE_WITH_TARGET_HOST_KEY"
-    (operating-system %system) +            (authorize? #t) 
-    (environment managed-host-environment-type) +            (allow-downgrades? #f) 
-    (configuration +            ;; vpsAdminOS supplies the kernel and exposes a dummy /dev/null root. 
-     (machine-ssh-configuration +            ;; Guix's bare-metal file-system/initrd checks cannot inspect it. 
-      ;; Replace the address and host key with those of your target VPS. +            (safety-checks? #f)))))) 
-      (host-name "192.0.2.3"+  (list target-machine))
-      (system "x86_64-linux"+
-      (user "root"+
-      (identity "/root/.ssh/id_ed25519"+
-      (host-key "ssh-ed25519 REPLACE_WITH_TARGET_HOST_KEY"+
-      (authorize? #t) +
-      (allow-downgrades? #f) +
-      ;; vpsAdminOS supplies the kernel and exposes a dummy /dev/null root. +
-      ;; Guix's bare-metal file-system/initrd checks cannot inspect it. +
-      (safety-checks? #f))))) +
- +
-(list %machine)+
 </code> </code>
  
manuals/distributions/guix.1786906590.txt.gz · Last modified: by aither