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 (sops secrets)
#:use-module (sops services sops)
#:export (base-operating-system))
#:export (base-operating-system
%oms-systems))
(define default-gsettings
#~(string-append "\
@ -196,40 +197,44 @@ sources=[('xkb', 'fi')]"))
(format #t "Latest generation is from ~a. No need to upgrade.~%"
(date->string (time-utc->date latest-generation))))))))
(define %oms-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))))
(simple-service
'check-upgrade-on-boot
shepherd-root-service-type
(list (shepherd-service
(provision '(upgrade-if-needed))
(requirement '(unattended-upgrade))
(one-shot? #t)
(start #~(make-forkexec-constructor
(list #$upgrade-if-needed-script)))))))
(operating-system-user-services base)))))))
(begin
(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))))
(simple-service
'check-upgrade-on-boot
shepherd-root-service-type
(list (shepherd-service
(provision '(upgrade-if-needed))
(requirement '(unattended-upgrade))
(one-shot? #t)
(start #~(make-forkexec-constructor
(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"))