diff options
author | Freya Murphy <freya@freyacat.org> | 2024-10-21 22:51:40 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-10-21 22:51:40 -0400 |
commit | fe5b074aae4a85340125c4c0bd4b74094a881388 (patch) | |
tree | ebd17741d9979734331fc252d834ec0efbd7725d /modules | |
parent | update commit pin, use linux 6.11 (diff) | |
download | dotfiles-guix-fe5b074aae4a85340125c4c0bd4b74094a881388.tar.gz dotfiles-guix-fe5b074aae4a85340125c4c0bd4b74094a881388.tar.bz2 dotfiles-guix-fe5b074aae4a85340125c4c0bd4b74094a881388.zip |
refactor system, add installer config
Diffstat (limited to 'modules')
-rw-r--r-- | modules/freya/system.scm | 410 |
1 files changed, 229 insertions, 181 deletions
diff --git a/modules/freya/system.scm b/modules/freya/system.scm index 2867e7b..ff4acbf 100644 --- a/modules/freya/system.scm +++ b/modules/freya/system.scm @@ -38,206 +38,254 @@ #:use-module (freya packages networking) #:use-module (freya packages virtualization)) -(define-public base-operating-system - (operating-system - (kernel linux-6.11) - (firmware (list linux-firmware - amd-microcode - sof-firmware)) - (locale "en_US.utf8") - (timezone "America/New_York") - (keyboard-layout (keyboard-layout "us")) - (host-name "ThisWillChange") - (users (cons* (user-account - (name "freya") - (comment "Freya Murphy") - (group "users") - (home-directory "/home/freya") - (shell (file-append zsh "/bin/zsh")) - (supplementary-groups '("wheel" - "audio" - "lp" - "docker" - "plugdev" - "libvirt" - "kvm" - "netdev" - "video" - "tty"))) - %base-user-accounts)) +(define-public %freya-user-accounts + (cons* (user-account + (name "freya") + (comment "Freya Murphy") + (group "users") + (home-directory "/home/freya") + (shell (file-append zsh "/bin/zsh")) + (supplementary-groups '("wheel" + "audio" + "lp" + "docker" + "plugdev" + "libvirt" + "kvm" + "netdev" + "video" + "tty"))) + %base-user-accounts)) - (packages (append (specifications->packages (list ; gtk - "wxwidgets" - "gtk+" - "dconf" - "gnome-themes-extra" - "adwaita-icon-theme" - "hicolor-icon-theme" - ; wayland x11 - "wl-clipboard" - "libx11" - "xorg-server-xwayland" - "xf86-video-qxl" +(define-public %freya-base-packages + (append - ; video audio - "mesa" - "mesa-utils" - "glu" - "libglvnd" - "vulkan-loader" - "vulkan-validationlayers" - "vulkan-tools" - "vulkan-headers" - "spirv-tools" - "spirv-headers" - "sdl2" - "openal" - "freealut" + ;; append guix and nonguix base packages + (specifications->packages (list ; video audio + "mesa" + "mesa-utils" - ; xdg - "xdg-utils" - "xdg-desktop-portal" + ; firmware + "sof-firmware" + "amd-microcode" + "v4l2loopback-linux-module" - ; firmware - "sof-firmware" - "amd-microcode" - "v4l2loopback-linux-module" + ; terrminal + "alsa-utils" + "vim" + "neovim" - ; needed programs - "qemu" - "alsa-utils" - "neovim" + ; basic utils + "curl" + "htop" + "git" + "zsh" + "opendoas" + "linux-pam" + "bind:utils" + "unzip" + "p7zip" + "acpi" + "tree" + "rlwrap" + "netcat" + "ripgrep" + "ncurses" + "jq" + "openssl")) - ; basic utils - "curl" - "htop" - "git" - "zsh" - "opendoas" - "linux-pam" - "bind:utils" - "unzip" - "p7zip" - "acpi" - "tree" - "rlwrap" - "netcat" - "ripgrep" - "ncurses" - "jq" - "openssl" + ;; append certs + (list freya-ca-certs) - ; system daemons - "docker" - "containerd" - "avahi" - "gnupg" - "light" - "brightnessctl" - "wireguard-tools" - "libpcap" + ;; append guix base packages + %base-packages)) - ; fonts - "font-fira-mono" - "font-google-noto-sans-cjk" - "font-jetbrains-mono" - "font-dejavu")) - (list ; qt - qt5-styleplugins - qt6gtk2 - ; bluetooth - bluez-new +(define-public %freya-packages + (append - ; pactl - pulseaudio-new + ;; append guix and nonguix packages + (specifications->packages (list ; gtk + "wxwidgets" + "gtk+" + "dconf" + "gnome-themes-extra" + "adwaita-icon-theme" + "hicolor-icon-theme" - ; system - virt-manager-ovmf - freya-ca-certs) - %base-packages)) + ; wayland x11 + "wl-clipboard" + "libx11" + "xorg-server-xwayland" + "xf86-video-qxl" - (services - (append (list - ; system - (service nix-service-type) - (service pam-limits-service-type) - (service openssh-service-type) - ; networking - (simple-service 'wireguard-module - kernel-module-loader-service-type - '("wireguard")) - ; printing - (service cups-service-type - (cups-configuration - (web-interface? #t))) - (service avahi-service-type - (avahi-configuration - (publish? #f) - (publish-workstation? #f))) - ; docker - (service docker-service-type) - (service containerd-service-type) - ; vms - (service libvirt-service-type - (libvirt-configuration - (libvirt libvirt-ovmf) - (unix-sock-group "libvirt") - (tls-port "16555"))) - (service virtlog-service-type) - (service spice-vdagent-service-type) - ; audio - (service bluetooth-service-type - (bluetooth-configuration - (bluez bluez-new) - (experimental #t) - (fast-connectable? #t))) - ; yubikey - (service pcscd-service-type) - (udev-rules-service 'fido2 libfido2 #:groups '("plugdev"))) + ; video audio + "glu" + "libglvnd" + "vulkan-loader" + "vulkan-validationlayers" + "vulkan-tools" + "vulkan-headers" + "spirv-tools" + "spirv-headers" + "sdl2" + "openal" + "freealut" - (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 - (append (list (local-file "../../certs/non-guix.pub")) - %default-authorized-guix-keys)))) - (udev-service-type config => - (udev-configuration - (inherit config))) - (delete pulseaudio-service-type) - (delete gdm-service-type) - (delete avahi-service-type) - (delete alsa-service-type) - (delete screen-locker-service-type)))) + ; xdg + "xdg-utils" + "xdg-desktop-portal" - (name-service-switch %mdns-host-lookup-nss) + ; system daemons + "docker" + "containerd" + "avahi" + "gnupg" + "light" + "brightnessctl" + "wireguard-tools" + "libpcap" + + ; fonts + "font-fira-mono" + "font-google-noto-sans-cjk" + "font-jetbrains-mono" + "font-dejavu" + + ; misc + "qemu")) + + ;; append custom packages + (list ; qt + qt5-styleplugins + qt6gtk2 + + ; bluetooth + bluez-new + + ; pactl + pulseaudio-new + + ; system + virt-manager-ovmf) + + ;; append freya base backages + %freya-base-packages)) + + +(define-public %freya-base-services + (append + + (list ; pam + (service pam-limits-service-type) + ; openssh + (service openssh-service-type)) + + ; base guix desktop services + (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 + (append (list (local-file "../../certs/non-guix.pub")) + %default-authorized-guix-keys)))) + (udev-service-type config => + (udev-configuration + (inherit config))) + (delete pulseaudio-service-type) + (delete gdm-service-type) + (delete avahi-service-type) + (delete alsa-service-type) + (delete screen-locker-service-type)))) - (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)) +(define-public %freya-services + (append + %freya-base-services + (list ; nix + (service nix-service-type) + ; wirerguard + (simple-service 'wireguard-module + kernel-module-loader-service-type + '("wireguard")) + + ; printing + (service cups-service-type + (cups-configuration + (web-interface? #t))) + (service avahi-service-type + (avahi-configuration + (publish? #f) + (publish-workstation? #f))) + + ; docker + (service docker-service-type) + (service containerd-service-type) + + ; libvirt + (service libvirt-service-type + (libvirt-configuration + (libvirt libvirt-ovmf) + (unix-sock-group "libvirt") + (tls-port "16555"))) + (service virtlog-service-type) + (service spice-vdagent-service-type) + + ; audio + (service bluetooth-service-type + (bluetooth-configuration + (bluez bluez-new) + (experimental #t) + (fast-connectable? #t))) + + ; yubikey + (service pcscd-service-type) + (udev-rules-service 'fido2 libfido2 #:groups '("plugdev"))))) + + +(define-public %freya-setuid-programs + (append (list ; doas + (file-like->setuid-program + (file-append + (specification->package "opendoas") + "/bin/doas"))) + ; base setuid programs + %setuid-programs)) + + +(define-public %freya-file-systems + (cons* + ; /tmp + (file-system + (mount-point "/tmp") + (device "none") + (type "tmpfs") + (check? #f)) + %base-file-systems)) + + +(define-public base-operating-system + (operating-system + (kernel linux-6.11) + (firmware (list linux-firmware + amd-microcode + sof-firmware)) + (locale "en_US.utf8") + (timezone "America/New_York") + (keyboard-layout (keyboard-layout "us")) + (host-name "ThisWillChange") + (users %freya-user-accounts) + (packages %freya-packages) + (services %freya-services) + (name-service-switch %mdns-host-lookup-nss) + (setuid-programs %freya-setuid-programs) + (file-systems %freya-file-systems) (bootloader (bootloader-configuration (bootloader uefi-uki-bootloader) (targets (list "/boot/efi")) |