guixconfig/config.scm
2023-12-14 22:49:12 +01:00

244 lines
6.5 KiB
Scheme

;; Modules
;; #+NAME: module-list
;; - gnu
;; - gnu image
;; - gnu services authentication
;; - gnu services base
;; - gnu services dbus
;; - gnu services desktop
;; - gnu services linux
;; - gnu services networking
;; - gnu services pm
;; - gnu services virtualization
;; - gnu services xorg
;; - gnu system nss
;; - nongnu packages linux
;; - nongnu system linux-initrd
;; [[file:config.org::*Modules][Modules:1]]
(use-modules
(gnu)
(gnu image)
(gnu services authentication)
(gnu services base)
(gnu services dbus)
(gnu services desktop)
(gnu services linux)
(gnu services networking)
(gnu services pm)
(gnu services virtualization)
(gnu services xorg)
(gnu system nss)
(nongnu packages linux)
(nongnu system linux-initrd))
;; Modules:1 ends here
;; Service Modules
;; #+NAME: service-module-list
;; - desktop
;; - xorg
;; [[file:config.org::*Service Modules][Service Modules:1]]
(use-service-modules desktop xorg)
;; Service Modules:1 ends here
;; Package Modules
;; #+NAME: package-module-list
;; - bootloaders
;; - certs
;; - emacs
;; - emacs-xyz
;; - fonts
;; - pciutils
;; - readline
;; - terminals
;; - version-control
;; - wm
;; - xorg
;; [[file:config.org::*Package Modules][Package Modules:1]]
(use-package-modules
bootloaders
certs
emacs
emacs-xyz
fonts
pciutils
readline
terminals
version-control
wm
xorg)
;; Package Modules:1 ends here
;; File System
;; The variable ~%local-filesystem~ extracts the file system definitions from the installer-provided
;; =config.scm= file.
;; [[file:config.org::*File System][File System:1]]
(define %local-filesystem
(call-with-input-file "/etc/config.scm"
(lambda (port)
(read port)
(read port)
(eval (cadar (last-pair (read port)))
(interaction-environment)))))
;; File System:1 ends here
;; As a sibling to the former, the variable ~%local-swap~ does the same with the swap partition.
;; [[file:config.org::*File System][File System:2]]
(define %local-swap
(call-with-input-file "/etc/config.scm"
(lambda (port)
(read port)
(read port)
(let* ((os-list (read port))
(os-list-length (length os-list)))
(eval
(cadr
(list-ref os-list
(- os-list-length 2)))
(interaction-environment))))))
;; File System:2 ends here
;; Operating System
;; This is the full operating system specification.
;; [[file:config.org::*Operating System][Operating System:1]]
(operating-system
(host-name "ziltis-machine")
(timezone "Europe/Berlin")
(locale "de_DE.utf8")
(keyboard-layout
(keyboard-layout "de" #:options '("caps:swapescape")))
(kernel linux)
(initrd microcode-initrd)
(firmware (list linux-firmware))
(bootloader
(bootloader-configuration
(bootloader grub-efi-bootloader)
(targets
'("/boot/efi"))
(keyboard-layout keyboard-layout)))
#;(file-systems %local-filesystem)
#;(swap-devices %local-swap)
(file-systems (append (list
(file-system
(device (file-system-label "EFI")
(mount-point "/boot/efi")
(type "vfat"))
(device (file-system-label "guix")
(mount-point "/")
(type "xfs"))))
%base-file-systems))
(swap-devices
(list (swap-space (target (file-system-label "swap")))))
(users
(cons*
(user-account
(name "zilti")
(group "users")
(supplementary-groups
'("wheel" "netdev" "audio" "video" "libvirt")))
%base-user-accounts))
(packages
(append
(list emacs
emacs-desktop-environment
font-terminus
git
hwdata
nss-certs
readline)
%base-packages))
(services
(append
(modify-services
%desktop-services
(delete login-service-type)
(delete mingetty-service-type)
(delete console-font-service-type)
(guix-service-type config => (guix-configuration
(inherit config)
(substitute-urls
(append (list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(append (list (plain-file "non-guix.pub"
"<<nonguix-pubkey>>")))))))
(list (service tlp-service-type (tlp-configuration))
(service
thermald-service-type
(thermald-configuration (adaptive? #t)))
(service
bluetooth-service-type
(bluetooth-configuration))
(service
earlyoom-service-type
(earlyoom-configuration
(minimum-available-memory 5)
(minimum-free-swap 5)))
(service
inputattach-service-type
(inputattach-configuration))
(service
libvirt-service-type
(libvirt-configuration
(unix-sock-group "libvirt")))
(service
fstrim-service-type
(fstrim-configuration))
(service
fprintd-service-type
(fprintd-configuration)))
(list
(service greetd-service-type
(greetd-configuration
(greeter-supplementary-groups
(list "video" "input"))
(terminals
(list
(greetd-terminal-configuration
(terminal-vt "1"))
(greetd-terminal-configuration
(terminal-vt "2"))
(greetd-terminal-configuration
(terminal-vt "3"))
(greetd-terminal-configuration
(terminal-vt "4"))
#;(greetd-terminal-configuration
(terminal-vt "7")
(terminal-switch #t)
(default-session-command
(greetd-wlgreet-session
(command
(file-append swayfx "/bin/sway")))))
(greetd-terminal-configuration
(terminal-vt "8")))))))
(list
(service screen-locker-service-type
(screen-locker-configuration
(name "swaylock")
(program
(file-append swaylock-effects "/bin/swaylock"))
(using-setuid? #f))))
))
(name-service-switch %mdns-host-lookup-nss))
;; Operating System:1 ends here