diff options
| -rw-r--r-- | deployment/channels.scm | 4 | ||||
| -rw-r--r-- | deployment/services/cuirass.scm | 10 | ||||
| -rw-r--r-- | deployment/specification.scm | 46 | ||||
| -rw-r--r-- | deployment/system.scm | 80 |
4 files changed, 120 insertions, 20 deletions
diff --git a/deployment/channels.scm b/deployment/channels.scm index fe20a4d..b75a39e 100644 --- a/deployment/channels.scm +++ b/deployment/channels.scm @@ -29,7 +29,7 @@ (define master-channels (list (default-guix-channel "master") (deployment-channel "master") - (mnt-reform-nonguix "personal") + ;; (mnt-reform-nonguix "personal") (nonguix-channel "master") (rde-channel "master") (sovereign-channel "master"))) @@ -37,7 +37,7 @@ (define test-channels (list (default-guix-channel "test") (deployment-channel "test") - (mnt-reform-nonguix "personal") + ;; (mnt-reform-nonguix "personal") (nonguix-channel "test") (rde-channel "master") (sovereign-channel "test"))) diff --git a/deployment/services/cuirass.scm b/deployment/services/cuirass.scm index 886091d..d06883a 100644 --- a/deployment/services/cuirass.scm +++ b/deployment/services/cuirass.scm @@ -19,19 +19,19 @@ ;;; If not, see <https://www.gnu.org/licenses/>. (define-module (deployment services cuirass) + #:export (cuirass-rakan_configuration-record) #:use-module (gnu services cuirass) #:use-module (guix gexp) + #:use-module ((deployment specification) + #:prefix deployment:specification:) #:use-module ((gnu packages ci) #:prefix gnu:packages:ci:) #:use-module ((sovereign services cuirass) - #:prefix sovereign:services:cuirass:) - #:export (cuirass-rakan_configuration-record)) + #:prefix sovereign:services:cuirass:)) (define cuirass-rakan_configuration-record (cuirass-configuration (inherit sovereign:services:cuirass:cuirass_configuration-record) - (specifications #~(list (specification - (name 'my-test-linux) - (build '(packages "linux-libre"))))))) + (specifications #~(list (ungexp deployment:specification:cuirass-deployment-test_specification-record))))) ;;; EOF diff --git a/deployment/specification.scm b/deployment/specification.scm new file mode 100644 index 0000000..6cbdc56 --- /dev/null +++ b/deployment/specification.scm @@ -0,0 +1,46 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; SPDX-FileCopyrightText: 2026 Marek Paśnikowski <marek@marekpasnikowski.pl> + +;;; COPYRIGHT NOTICE +;;; +;;; Copyright 2026, Marek Paśnikowski <marek@marekpasnikowski.pl> + +;;; LICENSE NOTICE +;;; +;;; This library is free software: you can redistribute it and/or modify it under the terms of +;;; the GNU General Public License as published by the Free Software Foundation, +;;; either version 3 of the License, or (at your option) any later version. +;;; +;;; This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; +;;; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +;;; See the GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License along with this library. +;;; If not, see <https://www.gnu.org/licenses/>. + +(define-module (deployment specification) + #:export (cuirass-deployment-test_specification-record) + #:use-module ((deployment channels) + #:prefix deployment:channels:) + #:use-module ((guix channels) + #:prefix guix:channels:)) + +(define (channels->code channels_list) + `(list ,@(map guix:channels:channel->code + channels_list))) + +(define cuirass-deployment-test_specification-record + `(specification + (name 'deployment-channel-test) + (build '(custom (deployment system))) + (channels ,(channels->code deployment:channels:test-channels)) + (build-outputs (list)) + (notifications (list)) + (period 0) + (priority 9) + (systems (list "x86_64-linux" + "aarch64-linux")) + (is-active? #t) + (properties (list)))) + +;;; EOF diff --git a/deployment/system.scm b/deployment/system.scm index 0b411da..bfeb407 100644 --- a/deployment/system.scm +++ b/deployment/system.scm @@ -19,20 +19,19 @@ ;;; If not, see <https://www.gnu.org/licenses/>. (define-module (deployment system) - #:export (aisaka - akashi - asakura - ayase - cokolwiek - mcdowell - rakan) #:use-module (deployment system file-systems) #:use-module (deployment services vpn) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) + #:use-module (gnu ci) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu system file-systems) #:use-module (gnu system shadow) + #:use-module (gnu system vm) #:use-module (guix gexp) + #:use-module (guix store) + #:use-module (guix utils) #:use-module (sovereign system file-systems) #:use-module (sovereign systems) #:use-module (users id1000) @@ -56,6 +55,8 @@ #:prefix gnu:packages:tls:) #:use-module ((gnu packages matrix) #:prefix gnu:packages:matrix:) + #:use-module ((gnu packages virtualization) + #:prefix gnu:packages:virtualization:) #:use-module ((gnu system) #:prefix gnu:system:) #:use-module ((gnu system file-systems) @@ -87,7 +88,7 @@ #:use-module ((users vmail) #:prefix users:vmail:)) -(define aisaka +(define-public aisaka (gnu:system:operating-system (kernel nongnu:packages:linux:linux) (kernel-loadable-modules (list)) @@ -130,9 +131,9 @@ (location (and=> (current-source-location) guix:diagnostics:source-properties->location)))) -(define akashi deployment:system:akashi:system) +(define-public akashi deployment:system:akashi:system) -(define asakura deployment:system:asakura:system) +(define-public asakura deployment:system:asakura:system) (define ayase (gnu:system:operating-system @@ -244,8 +245,61 @@ %sovereign-services)) (sudoers-file sovereign:systems:%sovereign-sudoers-specification))) -(define cokolwiek deployment:system:cokolwiek:system) +(define-public cokolwiek deployment:system:cokolwiek:system) -(define mcdowell deployment:system:mcdowell:system) +(define-public mcdowell deployment:system:mcdowell:system) -(define rakan deployment:system:rakan:system) +(define-public rakan deployment:system:rakan:system) + +;; Bound exactly once, while this file is being evaluated and the +;; current module is unambiguously this one. Renaming the module +;; changes nothing below: no name is ever involved in the scan. +(define this-module (current-module)) + +(define-public (cuirass-jobs store arguments) + ;; Cuirass requires this exact arity; ARGUMENTS is deliberately unused. + + (define (operating-system-entries module) + ;; (NAME . OPERATING-SYSTEM) pairs for every exported, OS-valued + ;; variable local to MODULE, sorted by NAME. With no #:export + ;; clause, "exported" means "declared with define-public", and the + ;; bindings yielded by module-map are bound by construction. + (let ((interface (module-public-interface module))) + (sort + (filter pair? + (module-map (lambda (name var) + (let ((value (variable-ref var))) + (and (module-local-variable interface name) + (gnu:system:operating-system? value) + (cons name value)))) + module)) + (lambda (a b) + (string<? (symbol->string (car a)) + (symbol->string (car b))))))) + + (define (os->job entry) + (let ((name (car entry)) + (os (cdr entry))) + (catch #t + (lambda () + (derivation->job + (symbol->string name) + (run-with-store store + (gnu:system:operating-system-derivation os)))) + (lambda (key . args) + ;; Add context, swallow nothing, re-throw the original error. + (format (current-error-port) + "error while computing derivation for system '~a': ~s~%" + name (cons key args)) + (apply throw key args))))) + + (let ((entries (operating-system-entries this-module))) + (if (null? entries) + (begin + (format (current-error-port) + "warning: no operating systems in module '~s'~%" + (module-name this-module)) + '()) + (map os->job entries)))) + +;;; EOF |
