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)
|
2024-11-20 18:28:10 +00:00
|
|
|
(flags '(no-dev strict-atime))
|
|
|
|
(options (format #f "mode=0755,~
|
|
|
|
nr_inodes=800k,~
|
|
|
|
size=20%")))
|
2024-11-03 04:43:37 +00:00
|
|
|
|
|
|
|
#|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)
|
2024-11-20 18:28:10 +00:00
|
|
|
(flags '(no-dev strict-atime))
|
|
|
|
(options (format #f "mode=0755,~
|
|
|
|
nr_inodes=800k,~
|
|
|
|
size=20%")))
|
2024-11-03 04:43:37 +00:00
|
|
|
|
2024-11-19 14:51:37 +00:00
|
|
|
#|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")))
|
|
|
|
|
2024-11-03 04:43:37 +00:00
|
|
|
#|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")
|
2024-11-06 17:07:07 +00:00
|
|
|
(check? #f)
|
2024-11-03 04:43:37 +00:00
|
|
|
(flags '(no-atime bind-mount))))
|
2024-11-06 17:07:07 +00:00
|
|
|
`("/etc/guix"
|
2024-11-19 14:52:20 +00:00
|
|
|
"/etc/ssh")))
|
2024-11-03 04:43:37 +00:00
|
|
|
|
|
|
|
(define persistent-files
|
2024-11-11 15:00:40 +00:00
|
|
|
(list "/etc/machine-id"
|
2024-11-03 04:43:37 +00:00
|
|
|
"/etc/wpa-supplicant.conf"))
|