Experimenting with New Guix Features


New Guix Features?

Let’s test out some (relatively) new Guix features!

The Final Configuration


(use-modules (gnu)
             (gnu home)
             (gnu home services shells)
             (gnu home services dotfiles)
             (guix channels))

(use-system-modules keyboard vm)
(use-package-modules package-management wm)
(use-service-modules guix spice desktop xorg)

(define my-channels
  (cons* (channel
          (name 'nonguix)
          (url "https://gitlab.com/nonguix/nonguix")
             "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5"))))

(define my-home
   (packages (list sway
   (services (list
              (service home-dotfiles-service-type
                        (source-directory "/home/daviwil/.dotfiles")
                        (directories '("./.files"))))
              (service home-bash-service-type)))))

(define test-os
    (host-name "crafter")
    (timezone "Europe/Athens")
    (locale "en_US.utf8")
    (keyboard-layout (keyboard-layout "us" "altgr-intl" #:model "thinkpad"))

    ;; This will be replaced
    (bootloader (bootloader-configuration
                 (bootloader grub-efi-bootloader)
                 (targets '("/boot/efi"))
                 (keyboard-layout keyboard-layout)))

    ;; Guix doesn't like it when there isn't a file-systems
    ;; entry, so add one that is meant to be overridden
    (file-systems (cons*
                     (mount-point "/tmp")
                     (device "none")
                     (type "tmpfs")
                     (check? #f))

    (users (cons (user-account
                  (name "crafter")
                  (comment "System Crafter")
                  (password (crypt "crafter" "$6$abc"))
                  (group "users")
                  (home-directory "/home/crafter")
                  (supplementary-groups '("wheel"

    (packages (append (map specification->package

    (services (cons* (service spice-vdagent-service-type)
                     (service guix-home-service-type
                              `(("crafter" ,my-home)))
                     (modify-services %desktop-services
                                      (delete gdm-service-type)
                                       config => (guix-configuration
                                                  (inherit config)
                                                  (channels my-channels)
                                                  (guix (guix-for-channels my-channels)))))))))

;; Configure `test-os` to run in a QEMU VM
(virtualized-operating-system test-os)



set -e
SCRIPT=$(guix system vm --persistent --expose=/home/daviwil config.scm)

guix shell virt-viewer -- $SCRIPT -m 2048 -smp 2 \
        -nic user,model=virtio-net-pci \
        -display spice-app,gl=on \
        -device virtio-vga-gl \
        -spice gl=on,unix=on \
        -audiodev spice,id=snd0 \
        -chardev spicevmc,name=vdagent,id=vdagent
Subscribe to the System Crafters Newsletter!
Stay up to date with the latest System Crafters news and updates! Read the Newsletter page for more information.
Name (optional)
Email Address