dotfiles-guix/modules/home-config/base-system.scm

204 lines
11 KiB
Scheme
Raw Normal View History

2023-09-05 03:21:01 +00:00
(define-module (home-config base-system)
2023-09-06 16:02:40 +00:00
#:use-module (gnu)
#:use-module (gnu system setuid)
2023-09-06 16:07:34 +00:00
#:use-module (gnu packages)
2023-09-06 16:02:40 +00:00
#:use-module (gnu packages admin)
#:use-module (gnu packages avahi)
#:use-module (gnu packages shells)
#:use-module (gnu packages tls)
2023-09-14 12:59:36 +00:00
#:use-module (gnu packages gcc)
2023-09-06 16:02:40 +00:00
#:use-module (gnu packages security-token)
#:use-module (gnu packages virtualization)
2023-09-06 16:07:34 +00:00
#:use-module (guix packages)
#:use-module (nongnu packages linux)
#:use-module (srfi srfi-1)
#:use-module (gnu services security-token)
2023-09-06 16:02:40 +00:00
#:use-module (gnu services cups)
#:use-module (gnu services desktop)
#:use-module (gnu services networking)
#:use-module (gnu services xorg)
#:use-module (gnu services ssh)
#:use-module (gnu services nix)
#:use-module (gnu services sound)
#:use-module (gnu services docker)
#:use-module (gnu services avahi)
2023-09-07 19:20:42 +00:00
#:use-module (gnu services spice)
2023-09-05 03:21:01 +00:00
#:use-module (gnu services authentication)
2023-09-06 16:02:40 +00:00
#:use-module (gnu services virtualization)
#:use-module (home-packages wm)
2023-09-07 03:50:18 +00:00
#:use-module (home-packages virtualization))
2023-09-05 03:21:01 +00:00
(define %my-base-packages
(remove (lambda (package)
2023-09-06 16:02:40 +00:00
(member (package-name package)
(list "sudo" "nano")))
%base-packages))
2023-09-05 03:21:01 +00:00
(define %backlight-udev-rule
(udev-rule
"90-backlight.rules"
(string-append "ACTION==\"add\", SUBSYSTEM==\"backlight\", "
"RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/%k/brightness\""
"\n"
"ACTION==\"add\", SUBSYSTEM==\"backlight\", "
"RUN+=\"/run/current-system/profile/bin/chmod g+w /sys/class/backlight/%k/brightness\"")))
(define-public base-operating-system
(operating-system
(kernel linux)
2023-09-06 16:02:40 +00:00
(firmware (list linux-firmware intel-microcode sof-firmware))
(locale "en_US.utf8")
(timezone "America/New_York")
(keyboard-layout (keyboard-layout "us"))
(host-name "ThisWillChange")
2023-09-05 03:21:01 +00:00
2023-09-06 16:02:40 +00:00
;; The list of user accounts ('root' is implicit).
(users (cons* (user-account
(name "tylerm")
(comment "Tyler")
(group "users")
(home-directory "/home/tylerm")
2023-09-05 03:21:01 +00:00
(shell (file-append zsh "/bin/zsh"))
2023-09-06 16:02:40 +00:00
(supplementary-groups '("wheel" "audio" "lp" "docker" "plugdev" "libvirt" "kvm" "netdev" "video" "tty")))
%base-user-accounts))
2023-09-05 03:21:01 +00:00
2023-09-06 16:02:40 +00:00
(packages (append (map specification->package (list "swayfx"
"swaybg"
2023-09-05 03:21:01 +00:00
"wlogout"
"sof-firmware"
"intel-microcode"
"alsa-utils"
2023-09-06 16:02:40 +00:00
"swayidle"
"dconf"
"alacritty"
"gnome-themes-extra"
2023-09-05 03:21:01 +00:00
"adwaita-icon-theme"
"hicolor-icon-theme"
2023-09-06 16:02:40 +00:00
"git"
"nss-certs"
"gvfs"
"gnupg"
"light"
"waybar"
"avahi"
"mako"
"grim"
"slurp"
"wl-clipboard"
"bluez"
"blueman"
"opendoas"
"xdg-desktop-portal"
"xdg-desktop-portal-wlr"
"v4l2loopback-linux-module"
"docker"
2023-09-05 03:21:01 +00:00
"linux-pam"
2023-09-06 16:02:40 +00:00
"pulseaudio"
2023-09-06 01:07:58 +00:00
"libx11"
"xorg-server-xwayland"
2023-09-05 03:21:01 +00:00
"fprintd"
2023-09-06 16:02:40 +00:00
"wireplumber"
2023-09-07 19:20:42 +00:00
"qemu"
"spice"
"xf86-video-qxl"
2023-09-06 16:02:40 +00:00
"zsh"
2023-09-07 19:20:42 +00:00
"mesa"
"mesa-utils"
"glu"
"vulkan-loader"
"vulkan-validationlayers"
"vulkan-tools"
"vulkan-headers"
"spirv-tools"
"spirv-headers"
2023-09-05 03:21:01 +00:00
"neovim"))
(list swaylock-effects-new virt-manager-new)
2023-09-05 03:21:01 +00:00
%my-base-packages))
2023-09-06 16:02:40 +00:00
;; Below is the list of system services. TO search for available
;; services. run 'guix system search KEYWORD' in a terminal.
(services
(append (list
2023-09-14 12:59:36 +00:00
;; To configure OpenSSH, pass an 'openssh-configuration'
;; record as a second argument to 'service' below.
(service openssh-service-type)
(service pcscd-service-type)
(service spice-vdagent-service-type)
(service cups-service-type
(cups-configuration
(web-interface? #t)))
;; Avahi is only present for CUPS to support "automagic" printing
(service avahi-service-type
(avahi-configuration
(publish? #f) ;; do not advertise this machiene
(publish-workstation? #f))) ; do not advertise, I want this to be as silent as possible
2023-09-06 16:02:40 +00:00
(service docker-service-type)
(service nix-service-type)
2023-09-07 03:50:18 +00:00
(service libvirt-service-type
(libvirt-configuration
(libvirt libvirt-new)
2023-09-07 19:20:42 +00:00
(unix-sock-group "libvirt")
(tls-port "16555")))
2023-09-06 16:02:40 +00:00
(service virtlog-service-type)
(service bluetooth-service-type)
2023-09-05 03:21:01 +00:00
(service pam-limits-service-type)
(service fprintd-service-type)
2023-09-14 12:59:36 +00:00
;; (service special-files-service-type
;; `(("/lib64" ,(directory-union "rustup-libs"
;; (list
;; (file-append glibc "/lib")
;; (file-append gcc "/lib"))))))
2023-09-06 16:02:40 +00:00
(udev-rules-service 'fido2 libfido2 #:groups '("plugdev")))
2023-09-05 03:21:01 +00:00
;; This is the default list of services we
2023-09-06 16:02:40 +00:00
;; are appending to.
2023-09-05 03:21:01 +00:00
(modify-services %desktop-services
(guix-service-type config =>
(guix-configuration
(inherit config)
(substitute-urls
(append (list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(cons* (plain-file "non-guix.pub"
"(public-key
(ecc
(curve Ed25519)
(q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)
)
)" ) %default-authorized-guix-keys))))
(udev-service-type config =>
(udev-configuration
(inherit config)))
(delete pulseaudio-service-type)
2023-09-06 16:02:40 +00:00
(delete gdm-service-type)
(delete avahi-service-type)
(delete alsa-service-type))))
2023-09-05 03:21:01 +00:00
(name-service-switch %mdns-host-lookup-nss)
(setuid-programs
(append (list (file-like->setuid-program
(file-append
;;(specification->package "swaylock")
swaylock-effects-new
"/bin/swaylock"))
(file-like->setuid-program
(file-append
(specification->package "opendoas")
"/bin/doas")))
(delete sudo %setuid-programs)))
(file-systems (cons*
(file-system
(mount-point "/tmp")
(device "none")
(type "tmpfs")
(check? #f))
%base-file-systems))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets (list "/boot/efi"))
(keyboard-layout keyboard-layout)))))