buersako
Luis Guilherme Coelho 2024-11-04 10:52:00 -03:00
parent add1a187ac
commit 3c6d2b913a
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
2 changed files with 146 additions and 146 deletions

View File

@ -106,28 +106,14 @@
(bootloader (bootloader
(bootloader-configuration (bootloader-configuration
(bootloader grub-bootloader) (bootloader grub-bootloader)
(targets `("/dev/sda")) (targets `("/dev/sda"))))
(theme (grub-theme
(color-normal
'((fg . light-gray) (bg . black)))
(color-highlight
'((fg . black) (bg . light-gray)))
(image (file-append %artwork-repository
"/backgrounds/guix-silver-16-9.svg"))
(gfxmode `("1280x720x32"))))))
(kernel linux-libre-6.11)
(kernel-arguments (kernel-arguments
(cons* "modprobe.blacklist=usbmouse,usbkbd,pcspkr" (cons* "thinkpad_acpi.fan_control=1"
"thinkpad_acpi.fan_control=1" %default-kernel-arguments))
(filter (negate ((on disjoin
(partial partial string-prefix?))
"debugfs" "l1tf" "mds" "mitigations" "nosmt"))
%kicksecure-kernel-arguments)))
(file-systems (file-systems
(append file-system:volumes (append %tmpfs-file-systems))
file-system:persistent-directories))
(users (users
(cons* user:radio (cons* user:radio
@ -176,12 +162,12 @@
(service seatd-service-type) (service seatd-service-type)
(service greetd-service-type (service greetd-service-type
(greetd-configuration (greetd-configuration
(greeter-supplementary-groups `("seat")) (greeter-supplementary-groups `("seat" "video"))
(terminals (terminals
(map (lambda (x) (map (lambda (x)
(greetd-terminal-configuration (greetd-terminal-configuration
(terminal-vt (number->string x)) (terminal-vt (number->string x))
(terminal-switch (= x 1)) (terminal-switch #t)
(default-session-command (default-session-command
(greetd-agreety-session (greetd-agreety-session
(command #~(getenv "SHELL")))))) (command #~(getenv "SHELL"))))))
@ -304,11 +290,6 @@
(service special-files-service-type (service special-files-service-type
`(("/bin/sh" ,(file-append bash "/bin/bash")) `(("/bin/sh" ,(file-append bash "/bin/bash"))
("/usr/bin/env" ,(file-append coreutils "/bin/env")))) ("/usr/bin/env" ,(file-append coreutils "/bin/env"))))
(simple-service 'persistent-files-service
special-files-service-type
(map (juxt identity
(partial string-append "/gnu/persist/"))
file-system:persistent-files))
#|Sysctl services|# #|Sysctl services|#
(simple-service 'extra-sysctl-settings sysctl-service-type (simple-service 'extra-sysctl-settings sysctl-service-type

View File

@ -1,134 +1,153 @@
(define-module (buer file-systems) (define-module (buer file-systems)
#:use-module (gnu system file-systems) #:use-module (gnu system file-systems)
#:export (%tmpfs-file-systems))
#:export (partition:guix (define guix-part
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")) (file-system-label "guix"))
(define volumes (define root
(list #|base|# (file-system
%immutable-store (device "none")
%pseudo-terminal-file-system (type "tmpfs")
%shared-memory-file-system (mount-point "/")
(check? #f)
(needed-for-boot? #t)
(options "mode=0755")))
#|boot|# (define home
(file-system (file-system
(device partition:guix) (device guix-part)
(type "btrfs") (type "btrfs")
(mount-point "/boot") (mount-point "/home")
(check? #f) (flags '(no-atime))
(needed-for-boot? #t) (options "subvol=@home,discard=async,ssd")))
(flags '(no-atime))
(options (format #f "subvol=@boot,~
discard=async,~
ssd")))
#|run|# (define root-user
(file-system (file-system
(device "none") (device guix-part)
(type "tmpfs") (type "btrfs")
(mount-point "/run") (mount-point "/root")
(check? #f) (flags '(no-atime))
(needed-for-boot? #t) (options "subvol=@root,discard=async,ssd")))
(options "mode=0755"))
#|root|# (define boot
(file-system (file-system
(device "none") (device guix-part)
(mount-point "/") (type "btrfs")
(check? #f) (mount-point "/boot")
(type "tmpfs") (check? #f)
(needed-for-boot? #t) (needed-for-boot? #t)
(options "mode=755")) (flags '(no-atime))
(options "subvol=@boot,discard=async,ssd")))
#|gnu|# (define tmp
(file-system (file-system
(device partition:guix) (device "none")
(type "btrfs") (type "tmpfs")
(mount-point "/gnu/persist") (mount-point "/tmp")
(needed-for-boot? #t) (check? #f)
(flags '(no-atime bind-mount)) (needed-for-boot? #f)))
(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 '(no-atime))
(options (format #f "compress=zstd:7,~
discard=async,~
ssd,~
subvol=@gnu/store")))
#|var|# (define run
(file-system (file-system
(device partition:guix) (device "none")
(type "btrfs") (type "tmpfs")
(mount-point "/var/guix") (mount-point "/run")
(needed-for-boot? #t) (check? #f)
(flags '(no-atime)) (needed-for-boot? #t)
(options (format #f "compress=zstd:7,~ (options "mode=0755")))
discard=async,~
ssd,~
subvol=@var/guix")))
(file-system
(device partition:guix)
(type "btrfs")
(mount-point "/var/log")
(needed-for-boot? #t)
(flags '(no-atime))
(options (format #f "compress=zstd:7,~
discard=async,~
ssd,~
subvol=@var/log")))
(file-system
(device "none")
(type "tmpfs")
(mount-point "/var/run")
(check? #f)
(needed-for-boot? #t)
(options "mode=0755"))
#|home|# (define var-run
(file-system (file-system
(device partition:guix) (device "none")
(type "btrfs") (type "tmpfs")
(mount-point "/root") (mount-point "/var/run")
(flags '(no-atime bind-mount)) (check? #f)
(options (format #f "compress=zstd:7,~ (needed-for-boot? #t)
discard=async,~ (options "mode=0755")))
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 (define var-log
(map (lambda (filename) (file-system
(file-system (device guix-part)
(mount-point filename) (type "btrfs")
(device (string-append "/gnu/persist" mount-point)) (mount-point "/var/log")
(type "none") (check? #f)
(flags '(no-atime bind-mount)))) (needed-for-boot? #t)
`("/etc/guix" (flags '(no-atime))
"/etc/ssh" (options "compress=zstd,subvol=@var/log,ssd")))
"/etc/wireguard")))
(define persistent-files (define var-lib
(list "/etc/machine-id" (file-system
"/etc/wpa-supplicant.conf")) (device guix-part)
(type "btrfs")
(mount-point "/var/lib")
(needed-for-boot? #t)
(flags '(no-atime))
(options "compress=zstd,subvol=@var/lib,ssd")))
(define var-guix
(file-system
(device guix-part)
(type "btrfs")
(mount-point "/var/guix")
(needed-for-boot? #t)
(flags '(no-atime))
(options "compress=zstd,subvol=@var/guix,ssd")))
(define gnu-store
(file-system
(device guix-part)
(type "btrfs")
(mount-point "/gnu/store")
(needed-for-boot? #t)
(flags '(no-atime))
(options "compress=zstd,subvol=@gnu/store,ssd")))
(define gnu-persist
(file-system
(device guix-part)
(type "btrfs")
(mount-point "/gnu/persist")
(needed-for-boot? #t)
(flags '(no-atime))
(options "subvol=@gnu/persist,ssd")))
(define gnu-persist-ssh
(file-system
(device "/gnu/persist/etc/ssh")
(type "none")
(mount-point "/etc/ssh")
(flags '(no-atime bind-mount))))
(define gnu-persist-guix
(file-system
(device "/gnu/persist/etc/guix")
(type "none")
(mount-point "/etc/guix")
(flags '(no-atime bind-mount))))
(define gnu-persist-wireguard
(file-system
(device "/gnu/persist/etc/wireguard")
(type "none")
(mount-point "/etc/wireguard")
(flags '(no-atime bind-mount))))
(define %tmpfs-file-systems
(cons* root
home
root-user
boot
tmp
run
var-run
var-log
var-lib
var-guix
gnu-store
gnu-persist
gnu-persist-ssh
gnu-persist-guix
gnu-persist-wireguard
(delete %debug-file-system
%base-file-systems)))