mirror of https://codeberg.org/anemofilia/zero
105 lines
3.3 KiB
Scheme
105 lines
3.3 KiB
Scheme
;; 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))
|