;; This is an operating system configuration for a VM image. ;; Modify it as you see fit and instantiate the changes by running: ;; ;; guix system reconfigure /etc/config.scm ;; (use-modules (gnu) (guix)) (use-service-modules networking ssh) (use-package-modules bootloaders certs linux package-management) (define vm-image-motd (plain-file "motd" " \x1b[1;37mThis is the GNU system. Welcome!\x1b[0m This instance of Guix is a template for virtualized environments. You can reconfigure the whole system by adjusting /etc/config.scm and running: guix system reconfigure /etc/config.scm Run '\x1b[1;37minfo guix\x1b[0m' to browse documentation. \x1b[1;33mConsider setting a password for the 'root' and 'guest' \ accounts.\x1b[0m ")) (operating-system (host-name "kalessin") (timezone "America/New_York") (locale "en_US.utf8") (initrd-modules (cons "virtio_scsi" %base-initrd-modules)) ;; Label for the GRUB boot menu. (label (string-append "GNU Guix " (package-version guix))) (firmware '()) ;; Below we assume /dev/vda is the VM's hard disk. ;; Adjust as needed. (bootloader (bootloader-configuration (bootloader grub-bootloader) (target "/dev/vda") (terminal-outputs '(console)))) (file-systems (cons (file-system (mount-point "/") (device (file-system-label "kalessin-btrfs")) (type "btrfs") (options "compress=zstd")) %base-file-systems)) (users (cons* (user-account (name "jackhill") (comment "Jack Hill") (group "users") (supplementary-groups '("wheel" "netdev"))) %base-user-accounts)) ;; Our /etc/sudoers file. Since 'guest' initially has an empty password, ;; allow for password-less sudo. (sudoers-file (plain-file "sudoers" "\ root ALL=(ALL) ALL %wheel ALL=NOPASSWD: ALL\n")) (packages (append (list btrfs-progs nss-certs) %base-packages)) (services (append (list (service openssh-service-type (openssh-configuration (password-authentication? #f) (authorized-keys `(("jackhill" ,(local-file "/id_ed25519.pub") ,(local-file "/home/jackhill/tamago.ssh-key") ,(local-file "/home/jackhill/id_ed25519.pub")))))) ;; Use the DHCP client service rather than NetworkManager. (service dhcp-client-service-type)) (modify-services %base-services (guix-service-type config => (guix-configuration (inherit config) (authorized-keys (cons (local-file "/home/jackhill/alperton-guix-key.pub") %default-authorized-guix-keys))))))))