From 25bae783ddbff74c05bd687e9b522200578cb83c Mon Sep 17 00:00:00 2001 From: Luis Guilherme Coelho Date: Thu, 26 Sep 2024 11:43:09 -0300 Subject: [PATCH] operating-systems: buer: Add (buer file-systems) --- operating-systems/buer/file-systems.scm | 104 ++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 operating-systems/buer/file-systems.scm diff --git a/operating-systems/buer/file-systems.scm b/operating-systems/buer/file-systems.scm new file mode 100644 index 0000000..66b69b2 --- /dev/null +++ b/operating-systems/buer/file-systems.scm @@ -0,0 +1,104 @@ +;; based on https://codeberg.org/squishypinkelephant/guix-random-junk + +;; how to guix: / as tmpfs + +;; /var/guix is REQUIRED to perform rollbacks +;; create the folders /gnu/persist/etc/ssh /gnu/persist/etc/wireguard and +;; the file /gnu/persist/etc/machine-id for dbus + +(define-module (buer file-systems) + #:use-module (gnu system file-systems) + + #:export (rootfs + bootfs + file-systems)) + +;;; reminder: Send a patch to guix to make file-system-options receive a +;;; list-of-strings + +(define rootfs + (file-system + (device (file-system-label "root")) + (mount-point "/") + (type "tmpfs") + (options "mode=755"))) + +(define bootfs + (file-system + (device (file-system-label "root") + (type "btrfs") + (mount-point "/boot") + (dependencies (list rootfs)) + (flags '(no-atime)) + (options (format #f "compress=zstd:7,~ + discard=async,~ + ssd,~ + subvol=@boot"))))) + +(define file-systems + (cons* rootfs + ;; /gnu/store + (file-system + (device (file-system-label "root")) + (type "btrfs") + (mount-point "/gnu/store") + (needed-for-boot? #t) + (dependencies (list rootfs)) + (flags '(read-only bind-mount no-atime)) + (options (format #f "compress=zstd:7,~ + discard=async,~ + ssd,~ + subvol=@gnu/store"))) + ;; /gnu/persist + (file-system + (device (file-system-label "root")) + (type "btrfs") + (mount-point "/gnu/persist") + (needed-for-boot? #t) + (dependencies (list rootfs)) + (flags '(no-atime bind-mount)) + (options (format #f "discard=async,~ + ssd,~ + subvol=@gnu/persist"))) + ;; /home + (file-system + (device (file-system-label "root")) + (type "btrfs") + (mount-point "/home") + (dependencies (list rootfs)) + (flags '(no-atime bind-mount)) + (options (format #f "compress=zstd:7,~ + discard=async,~ + ssd,~ + subvol=@home"))) + ;; /var/guix + (file-system + (device (file-system-label "root")) + (type "btrfs") + (mount-point "/var/guix") + (dependencies (list rootfs)) + (flags '(no-atime)) + (options (format #f "compress=zstd:7,~ + discard=async,~ + ssd,~ + subvol=@var/guix"))) + ;; /var/log + (file-system + (device (file-system-label "root")) + (type "btrfs") + (mount-point "/var/log") + (dependencies (list rootfs)) + (flags '(no-atime)) + (options (format #f "compress=zstd:7,~ + discard=async,~ + ssd,~ + subvol=@var/log"))) + ;; /boot + bootfs + (file-system + (device (file-system-label "esp")) + (type "vfat") + (dependencies (list bootfs)) + (mount-point "/boot/efi") + (create-mount-point? #t)) + %base-file-systems))