(define-module (oms systems) #:use-module (gnu) #:use-module (gnu packages cups) #:use-module (gnu services admin) #:use-module (gnu services base) #:use-module (gnu services cups) #:use-module (gnu services desktop) #:use-module (gnu services guix) #:use-module (gnu services ssh) #:use-module (gnu services xorg) #:use-module (guix gexp) #:use-module (nongnu packages linux) #:use-module (nongnu system linux-initrd) #:use-module (oms channel-file) #:export (base-operating-system)) (define* (base-operating-system host-name #:key (firmware (list linux-firmware))) (operating-system (kernel linux) (kernel-arguments (append '("resume=oms-guix-swap") %default-kernel-arguments)) (initrd microcode-initrd) (firmware firmware) (locale "fi_FI.utf8") (timezone "Europe/Helsinki") (keyboard-layout (keyboard-layout "fi")) (host-name host-name) (users (cons* (user-account (name "oms") (comment "Olarinmäen samoojat") (group "users") (home-directory "/home/oms") (supplementary-groups '("wheel" "netdev" "audio" "video"))) %base-user-accounts)) (services (append (list (service gnome-desktop-service-type) (service openssh-service-type (openssh-configuration (permit-root-login 'prohibit-password) (authorized-keys `(("root" ,(channel-file "keys/ssh/saku-laesvuori-x-kone.pub")))))) (service guix-publish-service-type (guix-publish-configuration (port 8001) (host "0.0.0.0") (advertise? #t))) (service cups-service-type (cups-configuration (web-interface? #t) (extensions (list cups-filters epson-inkjet-printer-escpr)))) (set-xorg-configuration (xorg-configuration (keyboard-layout keyboard-layout)))) (modify-services %desktop-services (guix-service-type config => (guix-configuration (inherit config) (discover? #t) (substitute-urls (append %default-substitute-urls ; more often used servers first (list "https://substitutes.nonguix.org"))) (authorized-keys (append (list (channel-file "keys/guix/nonguix.pub") (channel-file "keys/guix/saku-laesvuori-x-kone.pub")) %default-authorized-guix-keys)))) (gdm-service-type config => (gdm-configuration (inherit config) (auto-login? #t) (default-user "oms")))))) (bootloader (bootloader-configuration (bootloader grub-efi-bootloader) (targets (list "/boot/efi")) (keyboard-layout keyboard-layout))) (swap-devices (list (swap-space (target (file-system-label "oms-guix-swap")) (discard? #t)))) (file-systems (append (list (file-system (mount-point "/") (device (file-system-label "oms-btrfs-root")) (flags '(no-atime)) (options "compress-force=zstd") (type "btrfs")) (file-system (mount-point "/boot/efi") (device (file-system-label "OMS-F32-EFI")) (type "vfat")) (file-system (mount-point "/tmp") (device "tmpfs") (type "tmpfs") (check? #f) (flags '(no-dev no-suid)) (options "size=70%") (create-mount-point? #t))) %base-file-systems)))) (define-syntax-rule (define-system id os) "Extend the operating system OS with unattended upgrades and define a varible ID with the extended system as it's value." (define-public id (let ((base os)) (operating-system (inherit base) (services (append (list (service unattended-upgrade-service-type (unattended-upgrade-configuration (channels #~(cons (channel (name 'oms-tietokoneet) (url "https://git.olarinmaensamoojat.fi/OMS/tietokoneet.git") (branch "main") (introduction (make-channel-introduction "a3665902d411cd473636a836c2efd707b3a25cfd" (openpgp-fingerprint "A0C9 1947 734F 076F 5F08 E9FF 257D 284A 2A1D 3A32")))) %default-channels)) (operating-system-expression #~(@ (oms systems) id))))) (operating-system-user-services base))))))) (define-system oms-morn (base-operating-system "OMS-morn")) (define-system oms-celeb (let ((base (base-operating-system "OMS-celeb"))) (operating-system (inherit base) (initrd-modules (append '("vmd") (operating-system-initrd-modules base))))))