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