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

176 lines
5.0 KiB
Scheme
Raw Normal View History

(define-module (buer file-systems)
#:use-module (gnu system file-systems)
#:export (partition:guix
persistent-directories
persistent-files
volumes))
2024-10-21 00:14:14 +00:00
;;; 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|#
%immutable-store
%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")))
#|run|#
(file-system
(device "none")
(type "tmpfs")
(mount-point "/run")
(check? #f)
(needed-for-boot? #t)
(flags '(no-dev strict-atime))
(options (format #f "mode=0755,~
nr_inodes=800k,~
size=20%")))
#|tmp|#
(file-system
(device "none")
(type "tmpfs")
(mount-point "/tmp")
(check? #f)
(needed-for-boot? #f))
#|root|#
(file-system
(device "none")
(type "tmpfs")
(mount-point "/")
(check? #f)
(needed-for-boot? #t)
(options "mode=0755"))
#|gnu|#
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/gnu/persist")
(needed-for-boot? #t)
(flags '(no-atime))
(options (format #f "subvol=@gnu/persist,~
ssd")))
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/gnu/store")
(needed-for-boot? #t)
(flags '(no-atime))
(options (format #f "compress=zstd,~
subvol=@gnu/store,~
ssd")))
#|var|#
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/var/guix")
(needed-for-boot? #t)
(flags '(no-atime))
(options (format #f "compress=zstd,~
subvol=@var/guix,~
ssd")))
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/var/lib")
(needed-for-boot? #t)
(flags '(no-atime))
(options (format #f "compress=zstd,~
subvol=@var/lib,~
ssd")))
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/var/log")
(check? #f)
(needed-for-boot? #t)
(flags '(no-atime))
(options (format #f "compress=zstd,~
subvol=@var/log,~
ssd")))
(file-system
(device "none")
(type "tmpfs")
(mount-point "/var/run")
(check? #f)
(needed-for-boot? #t)
(flags '(no-dev strict-atime))
(options (format #f "mode=0755,~
nr_inodes=800k,~
size=20%")))
#|swap|#
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/swap")
(check? #f)
(needed-for-boot? #t)
(options (format #f "subvol=@swap,~
discard=async,~
ssd")))
#|snapshots|#
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/snapshots")
(check? #f)
(needed-for-boot? #t)
(flags '(no-atime))
(options (format #f "compress=zstd,~
subvol=@snapshots,~
ssd")))
#|home|#
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/root")
(flags '(no-atime))
(options (format #f "subvol=@root,~
discard=async,~
ssd")))
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/home")
(flags '(no-atime))
(options (format #f "subvol=@home,~
discard=async,~
ssd")))))
(define persistent-directories
(map (lambda (filename)
(file-system
(mount-point filename)
(device (string-append "/gnu/persist" mount-point))
(type "none")
(check? #f)
(flags '(no-atime bind-mount))))
`("/etc/guix"
"/etc/ssh")))
(define persistent-files
(list "/etc/machine-id"
"/etc/wpa-supplicant.conf"))