orchard

My personal GNU Guix configurations.
Log | Files | Refs | README

commit bd80744dc70a96c7e96de6fe5a6e5d64581ff93d
Author: Luke Willis <lukejw@loquat.dev>
Date:   Wed, 20 Aug 2025 15:24:32 -0400

Create git repo

Diffstat:
AREADME.md | 6++++++
Aorchard/home/lukejw.scm | 145+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aorchard/home/lukejw/scripts.scm | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Aorchard/home/lukejw/scripts/tofi-exit-sway-prompt.sh | 5+++++
Aorchard/home/lukejw/sway.scm | 196+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aorchard/system/abraham.scm | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aorchard/system/moses.scm | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 574 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,6 @@ +# Orchard +This is my personal collection of GNU Guix configurations. + +## Systems +- Abraham (Desktop) +- Moses (Laptop) diff --git a/orchard/home/lukejw.scm b/orchard/home/lukejw.scm @@ -0,0 +1,145 @@ +(define-module (orchard home lukejw) + #:use-module (gnu home) + #:use-module (gnu home services) + #:use-module (gnu home services desktop) + #:use-module (gnu home services fontutils) + #:use-module (gnu home services mpv) + #:use-module (gnu home services shells) + #:use-module (gnu home services sway) + #:use-module (gnu home services xdg) + #:use-module (gnu packages admin) + #:use-module (gnu packages base) + #:use-module (gnu packages emulators) + #:use-module (gnu packages fonts) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages games) + #:use-module (gnu packages gl) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gnome-xyz) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages librewolf) + #:use-module (gnu packages linux) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages polkit) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages qt) + #:use-module (gnu packages rsync) + #:use-module (gnu packages syndication) + #:use-module (gnu packages terminals) + #:use-module (gnu packages text-editors) + #:use-module (gnu packages toys) + #:use-module (gnu packages version-control) + #:use-module (gnu packages video) + #:use-module (gnu packages wm) + #:use-module (gnu packages xdisorg) + #:use-module (gnu services) + #:use-module (gnu system keyboard) + #:use-module (guix build-system copy) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (orchard home lukejw sway) + #:export (lukejw-home-environment)) + +(define wf-recorder-0.5.0 + (package + (inherit wf-recorder) + (name "wf-recorder") + (version "0.5.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ammen99/wf-recorder") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0a805kfbgpg7898gbb218n7krbvn9r96xydhibvrphy08wxd1xzg")))) + (inputs + (list ffmpeg pulseaudio wayland wayland-protocols mesa)))) + +;; TODO: Organize + +(define lukejw-home-environment + (home-environment + (packages + (list ;; Apps + pavucontrol-qt + librewolf + kakoune + newsraft + ;; Utils + git + rsync + ;; QT + lxqt-qtplugin + kvantum + oxygen-icons + breeze-icons + papirus-icon-theme + ;; GPG + gnupg + pinentry-qt + ;; Media + ffmpeg + wf-recorder-0.5.0 + yt-dlp + ;; Games + crispy-doom + freedoom + vkquake + ;; Emulation + jgrf + jg-bsnes + jg-nestopia + ;; Toys + cbonsai + cmatrix)) + (services + (append + (list + (service home-dbus-service-type) + (service home-bash-service-type + (home-bash-configuration + (guix-defaults? #f) + (aliases `(("gs" . "git status") + ("ga" . "git add") + ("gc" . "git commit") + ("gl" . "git log") + ("yta" . "yt-dlp -t aac -o \"~/Audio/%(channel)s/%(upload_date)s - %(title)s.%(ext)s\"") + ("guix-hr" . ,#~(string-append "guix home reconfigure -L " + #$(dirname (dirname (dirname (current-filename)))) + " " #$(current-filename))) + ("camera" . "ffplay -fflags nobuffer /dev/video0") + ("record" . "wf-recorder --audio -c h264_vaapi -d /dev/dri/renderD128"))) + (bash-profile + (list + (plain-file "start-sway-on-tty1" + "if [ \"$(tty)\" = \"/dev/tty1\" ]; then exec sway > ~/sway.log 2>&1; fi"))))) + ;; TODO: Make a home service for using kvantum with lxqt-qtplugin + (simple-service 'qt-environment-variables + home-environment-variables-service-type + `(("QT_QPA_PLATFORMTHEME" . "lxqt"))) + (simple-service 'jollygood-environment-variables + home-environment-variables-service-type + `(("JOLLYGOOD_ASSET_DIRS" . "$HOME/.guix-home/profile/share/jollygood") + ("JOLLYGOOD_CORE_DIRS" . "$HOME/.guix-home/profile/lib/jollygood"))) + (simple-service 'custom-fonts-service + home-fontconfig-service-type + (list "~/.guix-home/profile/share/fonts" + '(alias + (family "monospace") + (prefer + (family "Fira Mono"))))) + ;; TODO: Setup more advanced MPV config + (service home-mpv-service-type + (make-home-mpv-configuration + #:global (make-mpv-profile-configuration + #:hwdec '("auto") + #:alang '("en") + #:slang '("en")))) + (service home-sway-service-type %sway-configuration)) + %base-home-services)))) + +lukejw-home-environment diff --git a/orchard/home/lukejw/scripts.scm b/orchard/home/lukejw/scripts.scm @@ -0,0 +1,49 @@ +(define-module (orchard home lukejw scripts) + #:use-module (gnu packages shells) + #:use-module (guix build-system trivial) + #:use-module (guix gexp) + #:use-module (guix packages) + #:export (scripts)) + +(define dash-w-sh-symlink + (package + (inherit dash) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'install-sh-symlink + (lambda* (#:key outputs #:allow-other-keys) + ;; Add a `sh' -> `dash' link. + (let ((out (assoc-ref outputs "out"))) + (with-directory-excursion (string-append out "/bin") + (symlink "dash" "sh") + #t))))))))) + +(define scripts + (package + (name "scripts") + (version "0.1") + (source (local-file (string-append (dirname (current-filename)) + "/scripts") + #:recursive? #t)) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bin-dir (string-append %output "/bin")) + (dash-bin (string-append (assoc-ref %build-inputs "dash") + "/bin")) + (copy-script (lambda (file dest) + (copy-file file dest) + (patch-shebang dest (list dash-bin)) + (chmod dest #o555)))) + (mkdir-p bin-dir) + (copy-recursively (assoc-ref %build-inputs "source") bin-dir + #:copy-file copy-script))))) + (inputs `(("dash" ,dash-w-sh-symlink))) + (home-page #f) + (synopsis "My shell scripts") + (description #f) + (license #f))) diff --git a/orchard/home/lukejw/scripts/tofi-exit-sway-prompt.sh b/orchard/home/lukejw/scripts/tofi-exit-sway-prompt.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +case $(printf "Yes\\nNo" | tofi --prompt-text "Exit sway?") in + Yes) swaymsg exit ;; +esac diff --git a/orchard/home/lukejw/sway.scm b/orchard/home/lukejw/sway.scm @@ -0,0 +1,196 @@ +(define-module (orchard home lukejw sway) + #:use-module (orchard home lukejw scripts) + #:use-module (gnu home services sway) + #:use-module (gnu packages image) + #:use-module (gnu packages linux) + #:use-module (gnu packages lxqt) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages qt) + #:use-module (gnu packages terminals) + #:use-module (gnu packages wm) + #:use-module (gnu packages xdisorg) + #:use-module (gnu system keyboard) + #:use-module (guix build-system copy) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:export (%sway-configuration)) + +(define-public gruvbox-wallpapers + (package + (name "gruvbox-wallpapers") + (version "32817ad") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/AngelJumbo/gruvbox-wallpapers.git") + (commit "32817ad442c45dbff5b5ff870a07c114a7cb53e7"))) + (sha256 (base32 "1gcyxg5z3259rir0vh4jrn2wbyl4mhx2zqd64w8bnwnwnp3vqg5f")) + (file-name (git-file-name name version)))) + (build-system copy-build-system) + (arguments + (list #:install-plan + #~'(("wallpapers" "share/backgrounds")))) + (home-page "https://gruvbox-wallpapers.pages.dev/") + (synopsis "Gruvbox-themed wallpapers") + (description #f) + (license #f))) + +(define %sway-packages + (list sway + qtwayland + foot + tofi + pulseaudio + brightnessctl + i3blocks + lxqt-policykit + wlsunset + grim + slurp)) + +(define %sway-inputs + (list + (sway-input + (identifier "1:1:AT_Translated_Set_2_keyboard") + (layout (keyboard-layout "us,us" ",dvp" + #:options '("grp:alt_shift_toggle")))))) + +(define %sway-variables + `((mod . "Mod4") + (left . "Left") + (down . "Down") + (up . "Up") + (right . "Right") + ;; Programs + (term . "footclient") + (menu . "tofi-drun --terminal footclient | xargs swaymsg exec --") + (pactl . "pactl") + (bctl . "brightnessctl -q") + ;; Color palette + (acc . "#d79921") + (dbg . "#1d2021") + (bg . "#282828") + (bbg . "#928374") + (fg . "#ebdbb2"))) + +(define %sway-theme + (list "font monospace 14" + "client.focused $acc $acc $bg $fg" + "client.focused_inactive $bbg $bbg $bg $fg" + "client.unfocused $bg $bg $fg $bbg")) + +(define %sway-modes + (list (sway-mode + (mode-name "resize") + (keybindings + '(($left . "resize shrink width 10px") + ($down . "resize grow height 10px") + ($up . "resize shrink height 10px") + ($right . "resize grow width 10px") + (Return . "mode \"default\"") + (Escape . "mode \"default\"")))))) + +(define %sway-bar + (sway-bar + (position 'top) + (colors + (sway-color + (background "$bg") + (statusline "$fg\n separator $bbg") + (focused-workspace + (sway-border-color + (border "$acc") + (background "$acc") + (text "$bg"))) + (active-workspace + (sway-border-color + (border "$bbg") + (background "$bbg") + (text "$bg"))) + (inactive-workspace + (sway-border-color + (border "$bg") + (background "$bg") + (text "$fg"))))) + (status-command "i3blocks\n separator_symbol \" | \""))) + +(define %sway-keybindings + `(($mod+Return . "exec $term") + ($mod+Shift+q . "kill") + ($mod+d . "exec $menu") + ($mod+Shift+c . "reload") + ($mod+Shift+e . ,#~(string-append "exec " #$scripts "/bin/tofi-exit-sway-prompt.sh")) + ($mod+$left . "focus left") + ($mod+$down . "focus down") + ($mod+$up . "focus up") + ($mod+$right . "focus right") + ($mod+Shift+$left . "move left") + ($mod+Shift+$down . "move down") + ($mod+Shift+$up . "move up") + ($mod+Shift+$right . "move right") + ($mod+1 . "workspace number 1") + ($mod+2 . "workspace number 2") + ($mod+3 . "workspace number 3") + ($mod+4 . "workspace number 4") + ($mod+5 . "workspace number 5") + ($mod+6 . "workspace number 6") + ($mod+7 . "workspace number 7") + ($mod+8 . "workspace number 8") + ($mod+9 . "workspace number 9") + ($mod+Shift+1 . "move container to workspace number 1") + ($mod+Shift+2 . "move container to workspace number 2") + ($mod+Shift+3 . "move container to workspace number 3") + ($mod+Shift+4 . "move container to workspace number 4") + ($mod+Shift+5 . "move container to workspace number 5") + ($mod+Shift+6 . "move container to workspace number 6") + ($mod+Shift+7 . "move container to workspace number 7") + ($mod+Shift+8 . "move container to workspace number 8") + ($mod+Shift+9 . "move container to workspace number 9") + ($mod+b . "splith") + ($mod+v . "splitv") + ($mod+s . "layout stacking") + ($mod+w . "layout tabbed") + ($mod+e . "layout toggle split") + ($mod+f . "fullscreen") + ($mod+Shift+space . "floating toggle") + ($mod+space . "focus mode_toggle") + ($mod+a . "focus parent") + ($mod+Shift+minus . "move scratchpad") + ($mod+minus . "scratchpad show") + ($mod+r . "mode \"resize\"") + ;; Audio controls + (XF86AudioMute . "exec $pactl set-sink-mute \\@DEFAULT_SINK@ toggle") + (XF86AudioLowerVolume . "exec $pactl set-sink-volume \\@DEFAULT_SINK@ -5%") + (XF86AudioRaiseVolume . "exec $pactl set-sink-volume \\@DEFAULT_SINK@ +5%") + ;; Brightness controls + (XF86MonBrightnessDown . "exec $bctl s 15-") + (XF86MonBrightnessUp . "exec $bctl s +15") + ;; Screenshot controls + (Print . "exec grim") + (XF86SelectiveScreenshot . "exec grim -g \"$(slurp)\""))) + +(define %sway-outputs + (list (sway-output + (identifier '*) + (background (file-append gruvbox-wallpapers "/share/backgrounds/irl/forest.jpg"))))) + +(define %sway-startup-programs + (list + "foot --server" + "wlsunset -S 07:00 -s 19:30 -d 1800 -t 1000" + "lxqt-policykit-agent")) + +(define %sway-configuration + (sway-configuration + (variables %sway-variables) + (keybindings %sway-keybindings) + (gestures '()) + (packages %sway-packages) + (inputs %sway-inputs) + (outputs %sway-outputs) + (bar %sway-bar) + (modes %sway-modes) + (startup-programs %sway-startup-programs) + (extra-content %sway-theme))) + diff --git a/orchard/system/abraham.scm b/orchard/system/abraham.scm @@ -0,0 +1,83 @@ +(define-module (orchard system abraham) + #:use-module (guix gexp) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) + #:use-module (gnu packages games) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services guix) + #:use-module (gnu system) + #:use-module (gnu system keyboard) + #:use-module (gnu system nss) + #:use-module (gnu system shadow) + #:use-module (nongnu packages linux) + #:use-module (nongnu system linux-initrd) + #:use-module (loquat channels) + #:use-module (loquat packages linux) + #:use-module (loquat services) + #:use-module (loquat system) + #:use-module (orchard home lukejw) + #:export (abraham-os)) + +(define abraham-os + (operating-system + (host-name "abraham") + (timezone "America/New_York") + (locale "en_US.utf8") + + (keyboard-layout (keyboard-layout "us")) + + (kernel linux-lts) + (initrd microcode-initrd) + (firmware (list linux-firmware)) + + (name-service-switch %mdns-host-lookup-nss) + + ;; Use special wifi driver + (kernel-loadable-modules (list rtl88x2bu-linux-module)) + (kernel-arguments + (cons* "modprobe.blacklist=rtw88_8822bu" + %default-kernel-arguments)) + + (bootloader (bootloader-configuration + (bootloader grub-efi-bootloader) + (targets '("/boot/efi")) + (keyboard-layout keyboard-layout))) + + (swap-devices %loquat-swap-devices) + + (file-systems %loquat-file-systems) + + (users + (cons* + (user-account + (name "lukejw") + (comment "Luke") + (group "users") + (home-directory "/home/lukejw") + (supplementary-groups '("wheel" "netdev" "audio" "video"))) + %base-user-accounts)) + + (packages %loquat-base-packages) + + (services + (append + (list (service guix-home-service-type + `(("lukejw" ,lukejw-home-environment))) + (service greetd-service-type + (greetd-configuration + (motd "Welcome to Abraham!") + (terminals + (list + (greetd-terminal-configuration + (terminal-vt "1") + (terminal-switch #t)) + (greetd-terminal-configuration (terminal-vt "2")) + (greetd-terminal-configuration (terminal-vt "3"))))))) + (modify-services %loquat-clergy-base-services + (delete login-service-type) + (delete mingetty-service-type) + (delete console-font-service-type)) + %loquat-desktop-services)))) + +abraham-os diff --git a/orchard/system/moses.scm b/orchard/system/moses.scm @@ -0,0 +1,90 @@ +(define-module (orchard system moses) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix git) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader grub) + #:use-module (gnu packages bash) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages games) + #:use-module (gnu packages wm) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services desktop) + #:use-module (gnu services guix) + #:use-module (gnu system) + #:use-module (gnu system keyboard) + #:use-module (gnu system linux-initrd) + #:use-module (gnu system nss) + #:use-module (gnu system shadow) + #:use-module (nongnu packages linux) + #:use-module (nongnu system linux-initrd) + #:use-module (loquat channels) + #:use-module (loquat packages linux) + #:use-module (loquat services) + #:use-module (loquat system) + #:use-module (orchard home lukejw) + #:export (moses-os)) + +(define moses-os + (operating-system + (host-name "moses") + (timezone "America/New_York") + (locale "en_US.utf8") + + (keyboard-layout (keyboard-layout "us")) + + (kernel linux-lts) + (initrd (lambda (file-systems . rest) + (apply microcode-initrd file-systems + #:initrd base-initrd + #:microcode-packages (list amd-microcode) + rest))) + (firmware (list linux-firmware)) + + (name-service-switch %mdns-host-lookup-nss) + + (bootloader (bootloader-configuration + (bootloader grub-efi-bootloader) + (targets '("/boot/efi")) + (keyboard-layout keyboard-layout))) + + (swap-devices %loquat-swap-devices) + + (file-systems %loquat-file-systems) + + (users + (cons* + (user-account + (name "lukejw") + (comment "Luke Willis") + (group "users") + (home-directory "/home/lukejw") + (supplementary-groups '("wheel" "netdev" "audio" "video"))) + %base-user-accounts)) + + (packages %loquat-base-packages) + + (services + (append + (list (service greetd-service-type + (greetd-configuration + (motd "Hello, world!") + (terminals + (list + (greetd-terminal-configuration + (terminal-vt "1") + (terminal-switch #t)) + (greetd-terminal-configuration (terminal-vt "2")) + (greetd-terminal-configuration (terminal-vt "3"))))))) + (modify-services %loquat-clergy-base-services + (delete login-service-type) + (delete mingetty-service-type) + (delete console-font-service-type)) + (modify-services %loquat-desktop-services + (elogind-service-type config => (elogind-configuration + (inherit config) + (handle-lid-switch 'ignore) + (handle-lid-switch-external-power 'ignore)))))))) + +moses-os