From bd228c91f6833349eb178253f030e3a18f242b0e Mon Sep 17 00:00:00 2001 From: Saku Laesvuori Date: Wed, 19 Aug 2026 09:38:59 +0300 Subject: [PATCH] =?UTF-8?q?Luo=20lista=20kaikista=20k=C3=A4ytt=C3=B6j?= =?UTF-8?q?=C3=A4rjestelmist=C3=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/oms/systems.scm | 69 ++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/modules/oms/systems.scm b/modules/oms/systems.scm index 34db4e2..cdf3356 100644 --- a/modules/oms/systems.scm +++ b/modules/oms/systems.scm @@ -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"))