summaryrefslogtreecommitdiff
path: root/systems
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-10-22 21:02:08 -0400
committerFreya Murphy <freya@freyacat.org>2024-10-22 21:02:08 -0400
commita1d30ad8f36c54115c25ccb730748bfc6046d727 (patch)
tree6eb5ec17cc76fc3ab298b911cbb8088467f90c67 /systems
parentport cow store from guix internal (diff)
downloaddotfiles-guix-a1d30ad8f36c54115c25ccb730748bfc6046d727.tar.gz
dotfiles-guix-a1d30ad8f36c54115c25ccb730748bfc6046d727.tar.bz2
dotfiles-guix-a1d30ad8f36c54115c25ccb730748bfc6046d727.zip
refactor installer, add curiass system
Diffstat (limited to 'systems')
-rw-r--r--systems/curiass.scm24
-rw-r--r--systems/installer.scm102
-rw-r--r--systems/kaworu.scm7
-rw-r--r--systems/shinji.scm8
4 files changed, 37 insertions, 104 deletions
diff --git a/systems/curiass.scm b/systems/curiass.scm
new file mode 100644
index 0000000..cf6d04e
--- /dev/null
+++ b/systems/curiass.scm
@@ -0,0 +1,24 @@
+(use-modules (freya system)
+ (gnu))
+
+(operating-system
+ (inherit %virt-freya-operating-system)
+ (host-name "curiass")
+ (initrd-modules (cons* "virtio_scsi"
+ "mptspi"
+ (operating-system-initrd-modules
+ %virt-freya-operating-system)))
+ (file-systems (cons* (file-system
+ (mount-point "/")
+ (device (uuid "be5f9a76-8295-4710-95b1-370ae3eb0d95"))
+ (type "btrfs"))
+ (file-system
+ (mount-point "/boot")
+ (device (uuid "ACB1-EE58"
+ 'fat32))
+ (type "vfat"))
+ (operating-system-file-systems
+ %virt-freya-operating-system)))
+ (bootloader (bootloader-configuration
+ (bootloader grub-bootloader)
+ (target "/dev/sda"))))
diff --git a/systems/installer.scm b/systems/installer.scm
index 0fa161c..74fe087 100644
--- a/systems/installer.scm
+++ b/systems/installer.scm
@@ -1,110 +1,22 @@
; base system for creating installer images
(use-modules (freya system)
- (gnu packages disk)
- (gnu packages linux)
- (gnu packages cryptsetup)
- (gnu packages file-systems)
- (gnu services shepherd)
- (guix modules)
+ (freya services cow)
(gnu))
-; copy over installer disk utilites
-
-(define %installer-disk-utilities
- (list parted gptfdisk ddrescue
- lvm2-static
- cryptsetup mdadm
- dosfstools
- btrfs-progs
- e2fsprogs
- f2fs-tools
- jfsutils
- xfsprogs))
-
-; copy over cow store
-
-(define %backing-directory
- ;; Sub-directory used as the backing store for copy-on-write.
- "/tmp/guix-inst")
-
-(define cow-store-service-type
- (shepherd-service-type
- 'cow-store
- (lambda _
- (define (import-module? module)
- ;; Since we don't use deduplication support in 'populate-store', don't
- ;; import (guix store deduplication) and its dependencies, which
- ;; includes Guile-Gcrypt.
- (and (guix-module-name? module)
- (not (equal? module '(guix store deduplication)))))
-
- (shepherd-service
- (requirement '(root-file-system user-processes))
- (provision '(cow-store))
- (documentation
- "Make the store copy-on-write, with writes going to \
-the given target.")
-
- ;; This is meant to be explicitly started by the user.
- (auto-start? #f)
-
- (modules `((gnu build install)
- ,@%default-modules))
- (start
- (with-imported-modules (source-module-closure
- '((gnu build install))
- #:select? import-module?)
- #~(case-lambda
- ((target)
- (mount-cow-store target #$%backing-directory)
- target)
- (else
- ;; Do nothing, and mark the service as stopped.
- #f))))
- (stop #~(lambda (target)
- ;; Delete the temporary directory, but leave everything
- ;; mounted as there may still be processes using it since
- ;; 'user-processes' doesn't depend on us. The 'user-file-systems'
- ;; service will unmount TARGET eventually.
- (delete-file-recursively
- (string-append target #$%backing-directory))))))
- (description "Make the store copy-on-write, with writes going to \
-the given target.")))
-
-(define (cow-store-service)
- "Return a service that makes the store copy-on-write, such that writes go to
-the user's target storage device rather than on the RAM disk."
- ;; See <http://bugs.gnu.org/18061> for the initial report.
- (service cow-store-service-type 'mooooh!))
-
; installer system
(operating-system
- (inherit base-operating-system)
+ (inherit %base-freya-operating-system)
(host-name "installer")
-
- (file-systems
- (append %base-live-file-systems
- %base-file-systems))
-
- (users (list (user-account
- (name "root")
- (group "root")
- (supplementary-groups '("wheel")) ; allow use of sudo
- (password "")
- (comment "root"))))
-
+ (file-systems (append %base-live-file-systems
+ %base-file-systems))
(pam-services
;; Explicitly allow for empty passwords.
(base-pam-services #:allow-empty-passwords? #t))
-
- (packages (append %installer-disk-utilities
- %freya-base-packages))
-
- (services (append %freya-base-services
- (list (cow-store-service))))
-
+ (services (cons* (cow-store-service)
+ (operating-system-services
+ %base-freya-operating-system)))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets '("/dev/sda")))))
diff --git a/systems/kaworu.scm b/systems/kaworu.scm
index f254f6f..77625de 100644
--- a/systems/kaworu.scm
+++ b/systems/kaworu.scm
@@ -2,15 +2,13 @@
(gnu))
(operating-system
- (inherit base-operating-system)
+ (inherit %desktop-freya-operating-system)
(host-name "kaworu")
-
(mapped-devices (list (mapped-device
(source (uuid
"89257280-202b-4565-b832-89f160d5e4e2"))
(target "cryptroot")
(type luks-device-mapping))))
-
(file-systems (cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
@@ -21,4 +19,5 @@
(device (uuid "099A-D668"
'fat32))
(type "vfat"))
- %freya-file-systems)))
+ (operating-system-file-systems
+ %desktop-freya-operating-system))))
diff --git a/systems/shinji.scm b/systems/shinji.scm
index 3a48ea7..54b21ec 100644
--- a/systems/shinji.scm
+++ b/systems/shinji.scm
@@ -2,19 +2,16 @@
(gnu))
(operating-system
- (inherit base-operating-system)
+ (inherit %desktop-freya-operating-system)
(host-name "shinji")
-
(mapped-devices (list (mapped-device
(source (uuid
"ad489bfa-4280-44ea-8ad2-60347b516d60"))
(target "root")
(type luks-device-mapping))))
-
(swap-devices (list (swap-space
(target (uuid
"57caa02d-8569-43e3-8bf9-09dd6f02b191")))))
-
(file-systems (cons* (file-system
(mount-point "/")
(device "/dev/mapper/root")
@@ -25,4 +22,5 @@
(device (uuid "6F93-6A0B"
'fat32))
(type "vfat"))
- %freya-file-systems)))
+ (operating-system-file-systems
+ %desktop-freya-operating-system))))