From e32cdbe2c890a89c8fabb6a0af9a864eb5a61726 Mon Sep 17 00:00:00 2001 From: Jakub Dlugosz Date: Fri, 19 Sep 2025 18:53:48 +0200 Subject: Switch to btrfs --- src/jd/host.scm | 73 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 27 deletions(-) diff --git a/src/jd/host.scm b/src/jd/host.scm index d94d0e2..1bd5c30 100644 --- a/src/jd/host.scm +++ b/src/jd/host.scm @@ -6,39 +6,58 @@ #:use-module (gnu system mapped-devices) #:use-module (ice-9 match)) +(define mapped-devices + (list (mapped-device + (source (uuid "3fcc2e44-77bb-4a62-bbdc-f8c646fccbd2")) + (target "enc") + (type luks-device-mapping)))) + +(define btrfs-subvolumes + (map (match-lambda + ((subvol . mount-point) + (file-system + (type "btrfs") + (device "/dev/mapper/enc") + (mount-point mount-point) + (options (format #f "subvol=~a" subvol)) + (dependencies mapped-devices)))) + '((@ . "/") + (@boot . "/boot") + (@gnu . "/gnu") + (@nix . "/nix") + (@home . "/home") + (@data . "/data") + (@var-log . "/var/log")))) + +(define data-fs + (car + (filter + (lambda (x) (equal? (file-system-mount-point x) "/data")) + btrfs-subvolumes))) + +(define file-systems + (append + btrfs-subvolumes + (list + (file-system + (device "/data/system/var/lib") + (type "none") + (mount-point "/var/lib") + (flags '(bind-mount)) + (dependencies (list data-fs))) + (file-system + (mount-point "/boot/efi") + (type "vfat") + (device (uuid "82F1-2D6E" 'fat32)))))) + (define-public %host-features (list (feature-host-info #:host-name "berserker" #:timezone "Europe/Warsaw") (feature-file-systems - #:mapped-devices (list (mapped-device - (source (uuid - "1f2b1bf2-89fe-4e2c-8b40-c460572bb776")) - (target "crypthome") - (type luks-device-mapping))) - #:file-systems (list - (file-system - (mount-point "/") - (device (uuid - "c895e61e-1a5e-470f-b7aa-a502fc0b8596" - 'ext4)) - (type "ext4")) - (file-system - (mount-point "/boot/efi") - (device (uuid "9669-0171" - 'fat32)) - (type "vfat")) - (file-system - (mount-point "/home") - (device "/dev/mapper/crypthome") - (type "ext4") - (dependencies - (list (mapped-device - (source (uuid - "1f2b1bf2-89fe-4e2c-8b40-c460572bb776")) - (target "crypthome") - (type luks-device-mapping))))))) + #:mapped-devices mapped-devices + #:file-systems file-systems) (feature-kanshi #:extra-config `((profile laptop ((output eDP-1 enable))) -- cgit v1.2.3