2024-09-26 14:43:09 +00:00
|
|
|
(define-module (buer file-systems)
|
|
|
|
#:use-module (gnu system file-systems)
|
|
|
|
|
2024-11-03 04:43:37 +00:00
|
|
|
#:export (partition:guix
|
|
|
|
persistent-directories
|
|
|
|
persistent-files
|
|
|
|
volumes))
|
2024-09-26 14:43:09 +00:00
|
|
|
|
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
|
2024-09-26 14:43:09 +00:00
|
|
|
|
2024-11-03 04:43:37 +00:00
|
|
|
(define partition:guix
|
|
|
|
(file-system-label "guix"))
|
2024-09-26 14:43:09 +00:00
|
|
|
|
2024-11-03 04:43:37 +00:00
|
|
|
(define volumes
|
|
|
|
(list #|base|#
|
|
|
|
%immutable-store
|
|
|
|
%pseudo-terminal-file-system
|
|
|
|
%shared-memory-file-system
|
2024-09-26 14:43:09 +00:00
|
|
|
|
2024-11-03 04:43:37 +00:00
|
|
|
#|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)
|
|
|
|
(options "mode=0755"))
|
|
|
|
|
|
|
|
#|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)
|
|
|
|
(options "mode=0755"))
|
|
|
|
|
|
|
|
#|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)
|
2024-09-26 14:43:09 +00:00
|
|
|
(file-system
|
2024-11-03 04:43:37 +00:00
|
|
|
(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"))
|