From b4612bbbb73b88872e0d7372c8c9d4d347ae5e99 Mon Sep 17 00:00:00 2001 From: Marek Paśnikowski Date: Wed, 28 Aug 2024 13:46:50 +0200 Subject: fix(ayase): refactor swap-devices --- systems/ayase.scm | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'systems') 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") +;;; + +;; # +(define (swap-label number) + (file-system-label (string-append host-name + "-swap" + number))) + +;;; + +;; +(define swap-1 + (swap-space (target (swap-label "-1")))) + +;; +(define swap-2 + (swap-space (target (swap-label "-2")))) + +;;; + +;; (list ) +(define swap-devices + (list swap-1 + swap-2)) + ;; (list ) (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) -- cgit v1.2.3