guixsd-config

GuixSD configs for my systems
Log | Files | Refs

commit 3375dbe7d34029a3d868f7599cebc2e77a9b845e
parent 8ee7c8f53d39e0c8e3c2f8204e1c9bd8bc2fbcfb
Author: vin <git@vineetk.net>
Date:   Wed, 23 Jul 2025 03:00:18 -0400

start reorganizing

Diffstat:
Mepistemia/home/home-configuration.scm | 38+++++++++-----------------------------
Mepistemia/packages/suckless.scm | 9++++-----
Aepistemia/packages/zfs.scm | 13+++++++++++++
Aepistemia/services/zfs.scm | 40++++++++++++++++++++++++++++++++++++++++
Aepistemia/systems/base-system.scm | 47+++++++++++++++++++++++++++++++++++++++++++++++
Depistemia/systems/config.scm | 128-------------------------------------------------------------------------------
Aepistemia/systems/demiurge.scm | 67+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 180 insertions(+), 162 deletions(-)

diff --git a/epistemia/home/home-configuration.scm b/epistemia/home/home-configuration.scm @@ -1,23 +1,18 @@ -;; This "home-environment" file can be passed to 'guix home reconfigure' -;; to reproduce the content of your profile. This is "symbolic": it only -;; specifies package names. To reproduce the exact same profile, you also -;; need to capture the channels being used, as returned by "guix describe". -;; See the "Replicating Guix" section in the manual. - -(use-modules (gnu home) - (gnu packages) - (gnu services) - (guix gexp) - (gnu home services shells)) +(define-module (epistemia home home-configuration) + #:use-module (gnu home) + #:use-module (gnu packages) + #:use-module (gnu services) + #:use-module (gnu home services shells) + #:use-module (guix gexp)) (home-environment - ;; Below is the list of packages that will show up in your - ;; Home profile, under ~/.guix-home/profile. (packages (specifications->packages (list "curl" "htop" "git" "rsync" + "emacs-no-x-toolkit" + "xorg-server" "xf86-input-evdev" "xf86-video-amdgpu" @@ -25,19 +20,4 @@ "xwallpaper" "picom" - "ungoogled-chromium"))) - - ;; Below is the list of Home services. To search for available - ;; services, run 'guix home search KEYWORD' in a terminal. - (services - (append (list (service home-bash-service-type - (home-bash-configuration - (aliases '(("ls" . "ls -F --color=auto") - ("ll" . "ls -l"))) - (bashrc (list (local-file - "/home/vin/src/public/guix/.bashrc" - "bashrc"))) - (bash-profile (list (local-file - "/home/vin/src/public/guix/.bash_profile" - "bash_profile")))))) - %base-home-services))) + "qutebrowser")))) diff --git a/epistemia/packages/suckless.scm b/epistemia/packages/suckless.scm @@ -1,10 +1,9 @@ -(define-module (vin-dwm)) -(use-modules (gnu packages suckless) (gnu packages xorg) (guix gexp) (guix packages)) +(define-module (epistemia packages suckless) + #:use-module (gnu packages suckless) + #:export (vin-dwm)) (define-public vin-dwm (package (inherit dwm) - (name "vin-dwm") + (name "dwm") (source (local-file "dwm" #:recursive? #t)))) - -vin-dwm diff --git a/epistemia/packages/zfs.scm b/epistemia/packages/zfs.scm @@ -0,0 +1,13 @@ +(define-module (epistemia packages zfs) + #:use-module (guix packages) + #:use-module (gnu packages file-systems) + #:use-module (nongnu packages linux) + #:export (zfs-linux)) + +;; from raid5atemyhomework +(define-public zfs-linux + (package + (inherit zfs) + (arguments + (cons* #:linux linux-6.15 + (package-arguments zfs))))) diff --git a/epistemia/services/zfs.scm b/epistemia/services/zfs.scm @@ -0,0 +1,40 @@ +(define-module (epistemia services zfs) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (epistemia packages zfs) + #:export (zfs-shepherd-services)) + +;; from raid5atemyhomework's valiant efforts +(define zfs-shepherd-services + (let ((zpool (file-append zfs-linux "/sbin/zpool")) + (zfs (file-append zfs-linux "/sbin/zfs")) + (scheme-modules `((srfi srfi-1) + (srfi srfi-34) + (srfi srfi-35) + (rnrs io ports) + ,@%default-modules))) + (define zfs-scan + (shepherd-service + (provision '(zfs-scan)) + (documentation "Scans for ZFS pools.") + (requirement '(kernel-module-loader udev)) + (modules scheme-modules) + (start #~(lambda _ + (invoke/quiet #$zpool "import" "-a" "-N" "-d" "/dev/disk/by-id"))) + (stop #~(const #f)))) + (define zfs-automount + (shepherd-service + (provision '(zfs-automount)) + (documentation "Automounts ZFS data sets.") + (requirement '(zfs-scan)) + (modules scheme-modules) + (start #~(lambda _ + (with-output-to-port + (current-error-port) + (lambda () + (invoke #$zfs "mount" "-a" "-l"))))) + (stop #~(lambda _ + (chdir "/") + (invoke/quiet #$zfs "unmount" "-a" "-f") + #f)))) + (list zfs-scan zfs-automount))) diff --git a/epistemia/systems/base-system.scm b/epistemia/systems/base-system.scm @@ -0,0 +1,47 @@ +(define-module (epistemia systems base-system) + #:use-module (gnu) + #:use-module (guix) + #:export (base-system)) + +(use-package-modules shells ssh) + +(define base-system + (operating-system + (host-name "base") + (timezone "Canada/Eastern") + (locale "en_US.utf8") + + (users (cons (user-account + (name "vin") + (comment "Vineet") + (shell (file-append loksh "/bin/ksh")) + (group "users") + (supplementary-groups '("wheel" "audio" "video" "input" "seat" "tty"))) + %base-user-accounts)) + + ;; should be set per-system + (kernel '()) + (firmware '()) + + ;; will be overrided per-system + (bootloader (bootloader-configuration + (bootloader grub-efi-bootloader) + (targets '("/boot/efi")))) + + (file-systems (append + (list (file-system + (device (uuid "e2a1956c-51d1-4263-b8be-1961b6d24a46" 'f2fs)) + (mount-point "/") + (type "f2fs")) + (file-system + (device (uuid "EC1D-4A47" 'fat)) + (mount-point "/boot/efi") + (type "vfat"))) + %base-file-systems)) + + (packages (append (list loksh) + %base-packages)) + + (services (append (list (service dhcp-client-service-type) + (service openssh-service-type)) + %base-services)))) diff --git a/epistemia/systems/config.scm b/epistemia/systems/config.scm @@ -1,128 +0,0 @@ -;; -*- mode: scheme; -*- -(use-modules (gnu) (gnu services) (guix packages) (guix gexp) (nongnu packages linux) (nongnu system linux-initrd)) -(use-service-modules desktop linux networking shepherd ssh) -(use-package-modules admin bootloaders emacs emacs-xyz file file-systems rsync shells suckless version-control wm xorg) - -(define my-zfs - (package - (inherit zfs) - (arguments - (cons* #:linux linux-6.15 - (package-arguments zfs))))) - -(define zfs-shepherd-services - (let ((zpool (file-append my-zfs "/sbin/zpool")) - (zfs (file-append my-zfs "/sbin/zfs")) - (scheme-modules `((srfi srfi-1) - (srfi srfi-34) - (srfi srfi-35) - (rnrs io ports) - ,@%default-modules))) - (define zfs-scan - (shepherd-service - (provision '(zfs-scan)) - (documentation "Scans for ZFS pools.") - (requirement '(kernel-module-loader udev)) - (modules scheme-modules) - (start #~(lambda _ - (invoke/quiet #$zpool "import" "-a" "-N" "-d" "/dev/disk/by-id"))) - (stop #~(const #f)))) - (define zfs-automount - (shepherd-service - (provision '(zfs-automount)) - (documentation "Automounts ZFS data sets.") - (requirement '(zfs-scan)) - (modules scheme-modules) - (start #~(lambda _ - (with-output-to-port - (current-error-port) - (lambda () - (invoke #$zfs "mount" "-a" "-l"))))) - (stop #~(lambda _ - (chdir "/") - (invoke/quiet #$zfs "unmount" "-a" "-f") - #f)))) - (list zfs-scan zfs-automount))) - -(operating-system - (host-name "demiurge.epistemia") - (timezone "Canada/Eastern") - (locale "en_US.utf8") - - ;; Use the UEFI variant of GRUB with the EFI System - ;; Partition mounted on /boot/efi. - (bootloader (bootloader-configuration - (bootloader grub-efi-bootloader) - (targets '("/boot/efi")))) - - (kernel linux) - (kernel-arguments (list "net.ifnames=0")) - (kernel-loadable-modules (list (list my-zfs "module"))) - - (initrd microcode-initrd) - (firmware (cons* amdgpu-firmware %base-firmware)) - - ;; Assume the target root file system is labelled "my-root", - ;; and the EFI System Partition has UUID 1234-ABCD. - (file-systems (append - (list (file-system - (device (uuid "e2a1956c-51d1-4263-b8be-1961b6d24a46" 'f2fs)) - (mount-point "/") - (type "f2fs")) - (file-system - (device (uuid "EC1D-4A47" 'fat)) - (mount-point "/boot/efi") - (type "vfat"))) - %base-file-systems)) - - (users (cons (user-account - (name "vin") - (comment "Vineet") - (shell (file-append loksh "/bin/ksh")) - (group "users") - (supplementary-groups '("wheel" "audio" "video" "input" "seat" "tty"))) - %base-user-accounts)) - - ;; Add a bunch of window managers; we can choose one at - ;; the log-in screen with F1. - (packages (append (list - ;; window managers - emacs emacs-exwm - ;; xorg - seatd - xorg-server - xf86-input-evdev - xf86-video-amdgpu - dwm st dmenu - ;; basic shell utils - loksh - rsync - file - git - ;; filesystems - my-zfs) - %base-packages)) - - (services (append (list (simple-service 'my-zfs-loader - kernel-module-loader-service-type - '("zfs")) - (simple-service 'zfs-shepherd-services - shepherd-root-service-type - zfs-shepherd-services) -;; (simple-service 'zfs-shepherd-services-user-processes -;; user-processes-service-type -;; '(zfs-automount)) - (service seatd-service-type) - (service static-networking-service-type - (list (static-networking - (addresses - (list (network-address - (device "eth0") - (value "192.168.1.2/24")))) - (routes - (list (network-route - (destination "default") - (gateway "192.168.1.1")))) - (name-servers '("192.168.1.1"))))) - (service openssh-service-type)) - %base-services))) diff --git a/epistemia/systems/demiurge.scm b/epistemia/systems/demiurge.scm @@ -0,0 +1,67 @@ +(define-module (epistemia systems demiurge) + #:use-module (gnu) + #:use-module (gnu services desktop) + #:use-module (gnu services linux) + #:use-module (gnu services shepherd) + #:use-module (guix) + #:use-module (nongnu packages linux) + #:use-module (nongnu system linux-initrd) + #:use-module (epistemia systems base-system) + #:use-module (epistemia services zfs) + #:use-module (epistemia packages zfs)) + +(use-service-modules networking ssh) +(use-package-modules bootloaders emacs) + +(operating-system + (inherit base-system) + (host-name "demiurge") + + (kernel linux-6.15) + (kernel-arguments (list "net.ifnames=0")) + (kernel-loadable-modules (list (list zfs-linux "module"))) + + (initrd microcode-initrd) + (firmware (cons* amdgpu-firmware %base-firmware)) + + (bootloader (bootloader-configuration + (bootloader grub-efi-bootloader) + (targets '("/boot/efi")))) + + (file-systems (append + (list (file-system + (device (uuid "e2a1956c-51d1-4263-b8be-1961b6d24a46" 'f2fs)) + (mount-point "/") + (type "f2fs")) + (file-system + (device (uuid "EC1D-4A47" 'fat)) + (mount-point "/boot/efi") + (type "vfat"))) + %base-file-systems)) + + (packages (append (list emacs-no-x zfs-linux) + %base-packages)) + + (services (append (list (simple-service 'zfs-loader + kernel-module-loader-service-type + '("zfs")) + (simple-service 'zfs-shepherd-services + shepherd-root-service-type + zfs-shepherd-services) + (simple-service 'zfs-shepherd-services-user-processes + user-processes-service-type + '(zfs-automount)) + (service seatd-service-type) + (service static-networking-service-type + (list (static-networking + (addresses + (list (network-address + (device "eth0") + (value "192.168.1.2/24")))) + (routes + (list (network-route + (destination "default") + (gateway "192.168.1.1")))) + (name-servers '("192.168.1.1"))))) + (service openssh-service-type)) + %base-services)))