Luo lista kaikista käyttöjärjestelmistä

This commit is contained in:
Saku Laesvuori 2026-08-19 09:38:59 +03:00
parent e6cda914b4
commit bd228c91f6
Signed by: slaesvuo
GPG Key ID: 257D284A2A1D3A32

View File

@ -23,7 +23,8 @@
#:use-module (oms home) #:use-module (oms home)
#:use-module (sops secrets) #:use-module (sops secrets)
#:use-module (sops services sops) #:use-module (sops services sops)
#:export (base-operating-system)) #:export (base-operating-system
%oms-systems))
(define default-gsettings (define default-gsettings
#~(string-append "\ #~(string-append "\
@ -196,40 +197,44 @@ sources=[('xkb', 'fi')]"))
(format #t "Latest generation is from ~a. No need to upgrade.~%" (format #t "Latest generation is from ~a. No need to upgrade.~%"
(date->string (time-utc->date latest-generation)))))))) (date->string (time-utc->date latest-generation))))))))
(define %oms-systems '())
(define-syntax-rule (define-system id os) (define-syntax-rule (define-system id os)
"Extend the operating system OS with unattended upgrades and define a varible "Extend the operating system OS with unattended upgrades and define a varible
ID with the extended system as it's value." ID with the extended system as it's value."
(define-public id (begin
(let ((base os)) (define-public id
(operating-system (let ((base os))
(inherit base) (operating-system
(services (inherit base)
(append (services
(list (service unattended-upgrade-service-type (append
(unattended-upgrade-configuration (list (service unattended-upgrade-service-type
(channels (unattended-upgrade-configuration
#~(cons (channel (channels
(name 'oms-tietokoneet) #~(cons (channel
(url "https://git.olarinmaensamoojat.fi/OMS/tietokoneet.git") (name 'oms-tietokoneet)
(branch "main") (url "https://git.olarinmaensamoojat.fi/OMS/tietokoneet.git")
(introduction (branch "main")
(make-channel-introduction (introduction
"a3665902d411cd473636a836c2efd707b3a25cfd" (make-channel-introduction
(openpgp-fingerprint "a3665902d411cd473636a836c2efd707b3a25cfd"
"A0C9 1947 734F 076F 5F08 E9FF 257D 284A 2A1D 3A32")))) (openpgp-fingerprint
%default-channels)) "A0C9 1947 734F 076F 5F08 E9FF 257D 284A 2A1D 3A32"))))
(operating-system-expression %default-channels))
#~(@ (oms systems) id)))) (operating-system-expression
(simple-service #~(@ (oms systems) id))))
'check-upgrade-on-boot (simple-service
shepherd-root-service-type 'check-upgrade-on-boot
(list (shepherd-service shepherd-root-service-type
(provision '(upgrade-if-needed)) (list (shepherd-service
(requirement '(unattended-upgrade)) (provision '(upgrade-if-needed))
(one-shot? #t) (requirement '(unattended-upgrade))
(start #~(make-forkexec-constructor (one-shot? #t)
(list #$upgrade-if-needed-script))))))) (start #~(make-forkexec-constructor
(operating-system-user-services base))))))) (list #$upgrade-if-needed-script)))))))
(operating-system-user-services base))))))
(set! %oms-systems (cons id %oms-systems))))
(define-system oms-morn (base-operating-system "OMS-morn")) (define-system oms-morn (base-operating-system "OMS-morn"))