zero/operating-systems/buer/file-systems.scm

115 lines
3.4 KiB
Scheme

(define-module (buer file-systems)
#:use-module (gnu system file-systems)
#:export (persistent-directories
persistent-files
volumes))
;;; reminder: Send a patch to guix to make file-system-options and
;;; privileged-program-capabitilities receive a list-of-strings
(define partition:guix
(file-system-label "guix"))
(define volumes
(list #|base|#
%pseudo-terminal-file-system
%shared-memory-file-system
#|boot|#
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/boot")
(check? #f)
(needed-for-boot? #t)
(flags '(no-atime))
(options (format #f "subvol=@boot,~
discard=async,~
ssd")))
#|root|#
(file-system
(device "none")
(mount-point "/")
(check? #f)
(type "tmpfs")
(needed-for-boot? #t)
(options "mode=755"))
#|gnu|#
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/gnu/persist")
(needed-for-boot? #t)
(flags '(no-atime bind-mount))
(options (format #f "discard=async,~
ssd,~
subvol=@gnu/persist")))
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/gnu/store")
(needed-for-boot? #t)
(flags '(read-only bind-mount no-atime))
(options (format #f "compress=zstd:7,~
discard=async,~
ssd,~
subvol=@gnu/store")))
#|var|#
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/var/guix")
(flags '(no-atime))
(options (format #f "compress=zstd:7,~
discard=async,~
ssd,~
subvol=@var/guix")))
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/var/log")
(flags '(no-atime))
(options (format #f "compress=zstd:7,~
discard=async,~
ssd,~
subvol=@var/log")))
#|home|#
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/root")
(flags '(no-atime bind-mount))
(options (format #f "compress=zstd:7,~
discard=async,~
ssd,~
subvol=@root")))
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/home")
(flags '(no-atime bind-mount))
(options (format #f "compress=zstd:7,~
discard=async,~
ssd,~
subvol=@home")))))
(define persistent-directories
(map (lambda (filename)
(file-system
(mount-point filename)
(device (string-append "/gnu/persist" mount-point))
(type "none")
(flags '(no-atime bind-mount))))
`("/etc/guix"
"/etc/ssh"
"/etc/wireguard")))
(define persistent-files
(list "/etc/machine-id"
"/etc/wpa-supplicant.conf"))