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

207 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)
#:use-module (gnu packages vpn)
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)
#:use-module (gnu services linux)
#:use-module (gnu services authentication)
2023-09-06 16:07:34 +00:00
#: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 avahi)
2023-09-07 19:20:42 +00:00
#:use-module (gnu services spice)
2023-09-06 16:02:40 +00:00
#:use-module (gnu services virtualization)
#:use-module (home-packages wm)
2023-10-05 02:34:41 +00:00
#:use-module (home-packages certs)
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")
2023-10-02 16:29:28 +00:00
(comment "Tyler Murphy")
2023-09-06 16:02:40 +00:00
(group "users")
(home-directory "/home/tylerm")
2023-09-05 03:21:01 +00:00
(shell (file-append zsh "/bin/zsh"))
2023-10-09 00:48:02 +00:00
(supplementary-groups '("wheel" "audio" "lp" "plugdev" "libvirt" "kvm" "netdev" "video" "tty")))
2023-09-06 16:02:40 +00:00
%base-user-accounts))
2023-09-05 03:21:01 +00:00
2023-10-09 00:48:02 +00:00
(packages (append (map specification->package (list "sof-firmware" ;; core system
"intel-microcode" ;; kernel utils,drivers, firmware, etc.
"mesa"
"mesa-utils"
"linux-pam"
"openssl" ;; system packages
"ncurses" ;; usefull packages needed by scripts or packages
"acpi"
2023-09-06 16:02:40 +00:00
"git"
2023-10-09 00:48:02 +00:00
"binutils"
2023-09-06 16:02:40 +00:00
"nss-certs"
2023-10-09 00:48:02 +00:00
"opendoas"
"chrony"
2023-09-06 16:02:40 +00:00
"gnupg"
2023-10-26 14:17:04 +00:00
"flatpak"
2023-10-09 00:48:02 +00:00
"alsa-utils" ;; sound and bluetooth
"pulseaudio" ;; i am the one who knocks (and you hear it :3)
2023-09-06 16:02:40 +00:00
"bluez"
"blueman"
"wireplumber"
2023-10-09 00:48:02 +00:00
"glu" ;; drivers or modules s runtime packages or headers
"vulkan-loader" ;; usefull for devlopmet as headers or runtime dependicies with those headers
"vulkan-validationlayers" ;; mostly graphics
2023-09-07 19:20:42 +00:00
"vulkan-tools"
"vulkan-headers"
"spirv-tools"
"spirv-headers"
"sdl2"
"openal"
"freealut"
2023-10-09 00:48:02 +00:00
"xf86-video-qxl"
"v4l2loopback-linux-module"
2023-10-09 00:48:02 +00:00
"xdg-desktop-portal" ;; graphics
"xdg-desktop-portal-wlr" ;; xdg and other display utilities
"xorg-server-xwayland"
"libx11"
"wireguard-tools" ;; misc
"qemu" ;; shit i cant sort, they exist
"dconf"
"avahi"
"libpcap"
2023-09-05 03:21:01 +00:00
"neovim"))
2023-10-05 02:34:41 +00:00
(list swaylock-effects-new virt-manager-new freya-ca-certs)
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)
(simple-service 'wireguard-module
kernel-module-loader-service-type
'("wireguard"))
2023-09-14 12:59:36 +00:00
(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 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)
2023-10-07 16:24:28 +00:00
(service bluetooth-service-type
(bluetooth-configuration
(experimental #t)
(fast-connectable? #t)))
2023-09-05 03:21:01 +00:00
(service pam-limits-service-type)
(service fprintd-service-type)
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
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)))))