summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Paśnikowski <marek@marekpasnikowski.pl>2024-08-28 13:46:50 +0200
committerMarek Paśnikowski <marek@marekpasnikowski.pl>2024-08-28 13:59:27 +0200
commitb4612bbbb73b88872e0d7372c8c9d4d347ae5e99 (patch)
tree8614b4627d13ae512f8333b0227343f16c0c42e0
parent304444fd4260da82e1011a175666959cb69792fc (diff)
fix(ayase): refactor swap-devices
-rw-r--r--systems/ayase.scm38
1 files changed, 31 insertions, 7 deletions
diff --git a/systems/ayase.scm b/systems/ayase.scm
index 9e29d00..4560c0f 100644
--- a/systems/ayase.scm
+++ b/systems/ayase.scm
@@ -54,19 +54,46 @@
#:use-module (suweren services))
;; string
-(define host-name*
+(define host-name
"ayase")
+;;;
+
+;; #<file-system-label>
+(define (swap-label number)
+ (file-system-label (string-append host-name
+ "-swap"
+ number)))
+
+;;;
+
+;; <swap-space>
+(define swap-1
+ (swap-space (target (swap-label "-1"))))
+
+;; <swap-space>
+(define swap-2
+ (swap-space (target (swap-label "-2"))))
+
+;;;
+
+;; (list <swap-space>)
+(define swap-devices
+ (list swap-1
+ swap-2))
+
;; (list <user-account>)
(define users
(append %base-user-accounts
(list uid1000-account)))
+;;;
+
;; record* operating-system
(define-public operating-system*
(let* ((bootloader-targets (list "/boot/efi"))
(efi-filesystem-id (uuid "B4FB-CBD9" 'fat32))
- (home-environments `((,uid1000-name ,(uid1000-home-environment host-name*))))
+ (home-environments `((,uid1000-name ,(uid1000-home-environment host-name))))
(root-filesystem-id (uuid "615a98cd-a632-4ee5-a6f4-e5ebcaa6fb8c"))
(efi-partition (file-system (mount-point "/boot/efi")
@@ -77,13 +104,11 @@
(root-partition (file-system (mount-point "/")
(device root-filesystem-id)
(type "ext4")))
- (swap-space-id (uuid "f1c1b2ab-5c11-4708-80c2-d5ac99ff35cf"))
(ayase-file-systems (list root-partition
efi-partition))
(home-services (list home-services))
(keyboard-layout (keyboard-layout "pl"))
- (main-swap (swap-space (target swap-space-id)))
(system-services (list (service libvirt-service-type)
(service openssh-service-type)
(service tor-service-type)
@@ -111,14 +136,13 @@
))
(services (append %distribution-services
home-services
- system-services))
- (swap-devices (list main-swap)))
+ system-services)))
(operating-system (kernel linux)
(bootloader bootloader)
(keyboard-layout keyboard-layout)
(initrd microcode-initrd)
(firmware firmware)
- (host-name host-name*)
+ (host-name host-name)
(file-systems file-systems)
(swap-devices swap-devices)
(users users)