From 9b57cf604c1544ca63dea1a454f696b02002c8f3 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Wed, 1 Nov 2023 22:30:30 +0100 Subject: Add a simple test script This only evaluates each home and system config to make sure they're valid. Move the "nonfree installer" declaration to a subdirectory since evaluating it does too much -- it seems to trigger a "guix pull" somehow. --- Makefile | 12 ++++++++++++ tw/system/installer/nonfree.scm | 36 ++++++++++++++++++++++++++++++++++++ tw/system/nonfree-installer.scm | 36 ------------------------------------ 3 files changed, 48 insertions(+), 36 deletions(-) create mode 100644 Makefile create mode 100644 tw/system/installer/nonfree.scm delete mode 100644 tw/system/nonfree-installer.scm diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..6433bd9f --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +.PHONY: test tw/system/%.test tw/home/%.test + +systems = $(wildcard tw/system/*.scm) +homes = $(wildcard tw/home/*.scm) + +test: $(homes:.scm=.test) $(systems:.scm=.test) + +tw/home/%.test: tw/home/%.scm + guix home build -nL $(CURDIR) $< + +tw/system/%.test: tw/system/%.scm + guix system build -nL $(CURDIR) $< diff --git a/tw/system/installer/nonfree.scm b/tw/system/installer/nonfree.scm new file mode 100644 index 00000000..433d4302 --- /dev/null +++ b/tw/system/installer/nonfree.scm @@ -0,0 +1,36 @@ +(define-module (tw system installer nonfree) + #:use-module (gnu packages admin) + #:use-module (gnu packages linux) + #:use-module (gnu packages package-management) + #:use-module (gnu services) + #:use-module (gnu services ssh) + #:use-module (gnu system) + #:use-module ((guix gexp) #:select (local-file)) + #:use-module ((nongnu system install) + #:select (installation-os-nonfree)) + #:use-module ((srfi srfi-26) #:select (cut))) + +(operating-system + (inherit installation-os-nonfree) + (packages + (cons* efibootmgr htop guix + (operating-system-packages installation-os-nonfree))) + (services + (cons* + ;; Add an SSH server to facilitate remote installs. + (service openssh-service-type + (openssh-configuration + (port-number 22) + (%auto-start? #t) + (permit-root-login #t) + ;; The root account is passwordless, so make sure + ;; a password is set before allowing logins. + (allow-empty-passwords? #f) + (password-authentication? #f) + (authorized-keys + `(("root" ,(local-file "files/timo.pub")))))) + ;; Make sure to remove the SSH service from the base services, + ;; so we can override it fully. + (filter + (compose not (cut eq? openssh-service-type <>) service-kind) + ((@@ (gnu system install) %installation-services)))))) diff --git a/tw/system/nonfree-installer.scm b/tw/system/nonfree-installer.scm deleted file mode 100644 index bc363e95..00000000 --- a/tw/system/nonfree-installer.scm +++ /dev/null @@ -1,36 +0,0 @@ -(define-module (tw system nonfree-installer) - #:use-module (gnu packages admin) - #:use-module (gnu packages linux) - #:use-module (gnu packages package-management) - #:use-module (gnu services) - #:use-module (gnu services ssh) - #:use-module (gnu system) - #:use-module ((guix gexp) #:select (local-file)) - #:use-module ((nongnu system install) - #:select (installation-os-nonfree)) - #:use-module ((srfi srfi-26) #:select (cut))) - -(operating-system - (inherit installation-os-nonfree) - (packages - (cons* efibootmgr htop guix - (operating-system-packages installation-os-nonfree))) - (services - (cons* - ;; Add an SSH server to facilitate remote installs. - (service openssh-service-type - (openssh-configuration - (port-number 22) - (%auto-start? #t) - (permit-root-login #t) - ;; The root account is passwordless, so make sure - ;; a password is set before allowing logins. - (allow-empty-passwords? #f) - (password-authentication? #f) - (authorized-keys - `(("root" ,(local-file "files/timo.pub")))))) - ;; Make sure to remove the SSH service from the base services, - ;; so we can override it fully. - (filter - (compose not (cut eq? openssh-service-type <>) service-kind) - ((@@ (gnu system install) %installation-services)))))) -- cgit v1.2.3