From 2c9ca781629ce069d3e722493d24354a0155865b Mon Sep 17 00:00:00 2001 From: Skylar Hill Date: Mon, 15 Apr 2024 18:54:31 -0500 Subject: [PATCH] Prepare config to become more modular --- Sanderson.org | 385 ++++++++++++++++++++++++--------------------- home/sanderson.scm | 186 +++++++++++----------- sanderson.scm | 161 +++++++++---------- 3 files changed, 381 insertions(+), 351 deletions(-) diff --git a/Sanderson.org b/Sanderson.org index 0fec108..a0dbb28 100644 --- a/Sanderson.org +++ b/Sanderson.org @@ -1,192 +1,221 @@ * Sanderson config ** Main system +:PROPERTIES: +:header-args:scheme: :tangle sanderson.scm +:END: +*** Module imports +#+begin_src scheme +(use-modules (gnu) + (nongnu packages linux) + (nongnu system linux-initrd) + (gnu packages cups) + (nongnu packages printers)) +(use-service-modules cups desktop networking ssh syncthing xorg) +#+end_src -#+begin_src scheme :tangle sanderson.scm - (use-modules (gnu) - (nongnu packages linux) - (nongnu system linux-initrd) - (gnu packages cups) - (nongnu packages printers)) - (use-service-modules cups desktop networking ssh syncthing xorg) - (operating-system - (kernel linux) - (initrd microcode-initrd) - (firmware (list linux-firmware)) - (locale "en_US.utf8") - (timezone "America/Chicago") - (keyboard-layout (keyboard-layout "us")) - (host-name "sanderson") +*** Main OS config +#+begin_src scheme - ;; The list of user accounts ('root' is implicit). - (users (cons* (user-account - (name "skylar") - (comment "Skylar") - (group "users") - (home-directory "/home/skylar") - (supplementary-groups '("wheel" "netdev" "audio" "video"))) - %base-user-accounts)) +(operating-system + (kernel linux) + (initrd microcode-initrd) + (firmware (list linux-firmware)) + (locale "en_US.utf8") + (timezone "America/Chicago") + (keyboard-layout (keyboard-layout "us")) + (host-name "sanderson") - ;; Packages installed system-wide. Users can also install packages - ;; under their own account: use 'guix search KEYWORD' to search - ;; for packages and 'guix install PACKAGE' to install a package. - (packages (append (specifications->packages (list "nss-certs" - "stumpwm")) - %base-packages)) + ;; The list of user accounts ('root' is implicit). + (users (cons* (user-account + (name "skylar") + (comment "Skylar") + (group "users") + (home-directory "/home/skylar") + (supplementary-groups '("wheel" "netdev" "audio" "video"))) + %base-user-accounts)) +#+end_src - ;; Below is the list of system services. To search for available - ;; services, run 'guix system search KEYWORD' in a terminal. - (services - (append (list (service plasma-desktop-service-type) +*** System packages +#+begin_src scheme +;; Packages installed system-wide. Users can also install packages +;; under their own account: use 'guix search KEYWORD' to search +;; for packages and 'guix install PACKAGE' to install a package. +(packages (append (specifications->packages (list "nss-certs")) + %base-packages)) +#+end_src - ;; To configure OpenSSH, pass an 'openssh-configuration' - ;; record as a second argument to 'service' below. - (service openssh-service-type) - (service cups-service-type - (cups-configuration - (web-interface? #t) - (extensions - (list brlaser cups-filters epson-inkjet-printer-escpr foomatic-filters hplip hplip-plugin splix)))) - (set-xorg-configuration - (xorg-configuration (keyboard-layout keyboard-layout))) - (service syncthing-service-type - (syncthing-configuration - (user "skylar") - (home "/home/skylar"))) - (simple-service 'add-hosts - hosts-service-type - (list (host "192.168.254.167" "skylarhill.me") - (host "192.168.254.167" "vtt" - '("vtt.skylarhill.me")) - (host "192.168.254.167" "files" - '("files.skylarhill.me"))))) +*** Services +#+begin_src scheme +;; Below is the list of system services. To search for available +;; services, run 'guix system search KEYWORD' in a terminal. +(services + (append (list (service plasma-desktop-service-type) - ;; This is the default list of services we - ;; are appending to. - (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 "./signing-key.pub")) - %default-authorized-guix-keys))))))) - (bootloader (bootloader-configuration - (bootloader grub-bootloader) - (targets (list "/dev/sda")) - (keyboard-layout keyboard-layout))) - (swap-devices (list (swap-space - (target (uuid - "646006cb-84a4-46ea-a03c-78a343b2fd07"))))) + ;; To configure OpenSSH, pass an 'openssh-configuration' + ;; record as a second argument to 'service' below. + (service openssh-service-type) + (service cups-service-type + (cups-configuration + (web-interface? #t) + (extensions + (list brlaser cups-filters epson-inkjet-printer-escpr foomatic-filters hplip hplip-plugin splix)))) + (set-xorg-configuration + (xorg-configuration (keyboard-layout keyboard-layout))) + (service syncthing-service-type + (syncthing-configuration + (user "skylar") + (home "/home/skylar"))) + (simple-service 'add-hosts + hosts-service-type + (list (host "192.168.254.167" "skylarhill.me") + (host "192.168.254.167" "vtt" + '("vtt.skylarhill.me")) + (host "192.168.254.167" "files" + '("files.skylarhill.me"))))) +#+end_src - ;; The list of file systems that get "mounted". The unique - ;; file system identifiers there ("UUIDs") can be obtained - ;; by running 'blkid' in a terminal. - (file-systems (cons* (file-system - (mount-point "/") - (device (uuid - "38be76dc-b7d8-4433-bab6-04c6c7f62733" - 'ext4)) - (type "ext4")) %base-file-systems))) +*** nonguix substitutes +#+begin_src scheme +;; This is the default list of services we +;; are appending to. +(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 "./signing-key.pub")) + %default-authorized-guix-keys))))))) +#+end_src + +*** Filesystem and partition config +#+begin_src scheme +(bootloader (bootloader-configuration + (bootloader grub-bootloader) + (targets (list "/dev/sda")) + (keyboard-layout keyboard-layout))) +(swap-devices (list (swap-space + (target (uuid + "646006cb-84a4-46ea-a03c-78a343b2fd07"))))) + +;; The list of file systems that get "mounted". The unique +;; file system identifiers there ("UUIDs") can be obtained +;; by running 'blkid' in a terminal. +(file-systems (cons* (file-system + (mount-point "/") + (device (uuid + "38be76dc-b7d8-4433-bab6-04c6c7f62733" + 'ext4)) + (type "ext4")) %base-file-systems))) #+end_src ** Home configuration - -#+begin_src scheme :tangle home/sanderson.scm - (use-modules (gnu home) - (gnu home services) - (gnu packages) - (gnu packages emacs-xyz) - (gnu packages gnupg) - (gnu packages scheme) - (gnu packages text-editors) - (gnu services) - (guix build-system emacs) - (guix build-system font) - (guix download) - (guix gexp) - (guix packages) - (gnu home services shells) - (gnu home services gnupg)) - - (home-environment - ;; Below is the list of packages that will show up in your - ;; Home profile, under ~/.guix-home/profile. - (packages (specifications->packages - (list "bat" - "blinkenlights" - "calibre" - "cups" - "curl" - "emacs" - "fd" - "firefox" - "font-fira-code" - "font-google-noto" - "font-google-noto-emoji" - "font-google-noto-serif-cjk" - "font-microsoft-web-core-fonts" - "font-sony-misc" - "gerbil" - "git" - "gnupg" - "gnutls" - "hicolor-icon-theme" - "hplip" - "ispell" - "kitty" - "kmonad" - "kwallet" - "markdown" - "nheko" - "offlineimap3" - "okular" - "opentaxsolver" - "mu" - "pamixer" - "password-store" - "pavucontrol" - "python" - "ripgrep" - "rofi" - "rofi-pass" - "sbcl-stumpwm-pamixer" - "smtpmail" - "steam" - "stumpwm" - "swi-prolog" - "unzip" - "xclip" - "zoom"))) - - ;; Below is the list of Home services. To search for available - ;; services, run 'guix home search KEYWORD' in a terminal. - (services - (list (service home-bash-service-type - (home-bash-configuration - (aliases '(("grep" . "grep --color=auto") - ("ip" . "ip -color=auto") - ("ll" . "ls -l") - ("ls" . "ls -p --color=auto"))) - (bashrc (list (local-file - "/home/skylar/.config/guix/home/.bashrc" - "bashrc"))) - (bash-profile (list (local-file - "/home/skylar/.config/guix/home/.bash_profile" - "bash_profile"))))) - (service home-gpg-agent-service-type - (home-gpg-agent-configuration - (pinentry-program - (file-append pinentry "/bin/pinentry")) - (default-cache-ttl 86400) - (max-cache-ttl 86400) - (ssh-support? #t))) - (service home-files-service-type - `((".offlineimaprc" ,(local-file "offlineimaprc")) - (".config/rofi/config.rasi" ,(local-file "rofi.rasi")) - (".local/bin/offlineimap-pass.py" ,(local-file "offlineimap-pass.py")) - (".doom.d/config.el" ,(local-file "doom/config.el")) - (".doom.d/init.el" ,(local-file "doom/init.el")) - (".doom.d/packages.el" ,(local-file "doom/packages.el"))))))) +:PROPERTIES: +:header-args:scheme: :tangle home/sanderson.scm +:END: +*** Module imports +#+begin_src scheme +(use-modules (gnu home) + (gnu home services) + (gnu packages) + (gnu packages emacs-xyz) + (gnu packages gnupg) + (gnu packages scheme) + (gnu packages text-editors) + (gnu services) + (guix build-system emacs) + (guix build-system font) + (guix download) + (guix gexp) + (guix packages) + (gnu home services shells) + (gnu home services gnupg)) +#+end_src + +*** Home packages +#+begin_src scheme +(home-environment + ;; Below is the list of packages that will show up in your + ;; Home profile, under ~/.guix-home/profile. + (packages (specifications->packages + (list "bat" + "blinkenlights" + "calibre" + "cups" + "curl" + "emacs" + "fd" + "firefox" + "font-fira-code" + "font-google-noto" + "font-google-noto-emoji" + "font-google-noto-serif-cjk" + "font-microsoft-web-core-fonts" + "font-sony-misc" + "gerbil" + "git" + "gnupg" + "gnutls" + "hicolor-icon-theme" + "hplip" + "ispell" + "kitty" + "kmonad" + "kwallet" + "markdown" + "nheko" + "offlineimap3" + "okular" + "opentaxsolver" + "mu" + "pamixer" + "password-store" + "pavucontrol" + "python" + "ripgrep" + "rofi" + "rofi-pass" + "sbcl-stumpwm-pamixer" + "smtpmail" + "steam" + "stumpwm" + "swi-prolog" + "unzip" + "xclip" + "zoom"))) +#+end_src + +*** Home services +#+begin_src scheme +;; Below is the list of Home services. To search for available +;; services, run 'guix home search KEYWORD' in a terminal. +(services + (list (service home-bash-service-type + (home-bash-configuration + (aliases '(("grep" . "grep --color=auto") + ("ip" . "ip -color=auto") + ("ll" . "ls -l") + ("ls" . "ls -p --color=auto"))) + (bashrc (list (local-file + "/home/skylar/.config/guix/home/.bashrc" + "bashrc"))) + (bash-profile (list (local-file + "/home/skylar/.config/guix/home/.bash_profile" + "bash_profile"))))) + (service home-gpg-agent-service-type + (home-gpg-agent-configuration + (pinentry-program + (file-append pinentry "/bin/pinentry")) + (default-cache-ttl 86400) + (max-cache-ttl 86400) + (ssh-support? #t))) + (service home-files-service-type + `((".offlineimaprc" ,(local-file "offlineimaprc")) + (".config/rofi/config.rasi" ,(local-file "rofi.rasi")) + (".local/bin/offlineimap-pass.py" ,(local-file "offlineimap-pass.py")) + (".doom.d/config.el" ,(local-file "doom/config.el")) + (".doom.d/init.el" ,(local-file "doom/init.el")) + (".doom.d/packages.el" ,(local-file "doom/packages.el"))))))) #+end_src diff --git a/home/sanderson.scm b/home/sanderson.scm index b8ea67b..503c4a1 100644 --- a/home/sanderson.scm +++ b/home/sanderson.scm @@ -1,95 +1,95 @@ - (use-modules (gnu home) - (gnu home services) - (gnu packages) - (gnu packages emacs-xyz) - (gnu packages gnupg) - (gnu packages scheme) - (gnu packages text-editors) - (gnu services) - (guix build-system emacs) - (guix build-system font) - (guix download) - (guix gexp) - (guix packages) - (gnu home services shells) - (gnu home services gnupg)) +(use-modules (gnu home) + (gnu home services) + (gnu packages) + (gnu packages emacs-xyz) + (gnu packages gnupg) + (gnu packages scheme) + (gnu packages text-editors) + (gnu services) + (guix build-system emacs) + (guix build-system font) + (guix download) + (guix gexp) + (guix packages) + (gnu home services shells) + (gnu home services gnupg)) - (home-environment - ;; Below is the list of packages that will show up in your - ;; Home profile, under ~/.guix-home/profile. - (packages (specifications->packages - (list "bat" - "blinkenlights" - "calibre" - "cups" - "curl" - "emacs" - "fd" - "firefox" - "font-fira-code" - "font-google-noto" - "font-google-noto-emoji" - "font-google-noto-serif-cjk" - "font-microsoft-web-core-fonts" - "font-sony-misc" - "gerbil" - "git" - "gnupg" - "gnutls" - "hicolor-icon-theme" - "hplip" - "ispell" - "kitty" - "kmonad" - "kwallet" - "markdown" - "nheko" - "offlineimap3" - "okular" - "opentaxsolver" - "mu" - "pamixer" - "password-store" - "pavucontrol" - "python" - "ripgrep" - "rofi" - "rofi-pass" - "sbcl-stumpwm-pamixer" - "smtpmail" - "steam" - "stumpwm" - "swi-prolog" - "unzip" - "xclip" - "zoom"))) +(home-environment + ;; Below is the list of packages that will show up in your + ;; Home profile, under ~/.guix-home/profile. + (packages (specifications->packages + (list "bat" + "blinkenlights" + "calibre" + "cups" + "curl" + "emacs" + "fd" + "firefox" + "font-fira-code" + "font-google-noto" + "font-google-noto-emoji" + "font-google-noto-serif-cjk" + "font-microsoft-web-core-fonts" + "font-sony-misc" + "gerbil" + "git" + "gnupg" + "gnutls" + "hicolor-icon-theme" + "hplip" + "ispell" + "kitty" + "kmonad" + "kwallet" + "markdown" + "nheko" + "offlineimap3" + "okular" + "opentaxsolver" + "mu" + "pamixer" + "password-store" + "pavucontrol" + "python" + "ripgrep" + "rofi" + "rofi-pass" + "sbcl-stumpwm-pamixer" + "smtpmail" + "steam" + "stumpwm" + "swi-prolog" + "unzip" + "xclip" + "zoom"))) - ;; Below is the list of Home services. To search for available - ;; services, run 'guix home search KEYWORD' in a terminal. - (services - (list (service home-bash-service-type - (home-bash-configuration - (aliases '(("grep" . "grep --color=auto") - ("ip" . "ip -color=auto") - ("ll" . "ls -l") - ("ls" . "ls -p --color=auto"))) - (bashrc (list (local-file - "/home/skylar/.config/guix/home/.bashrc" - "bashrc"))) - (bash-profile (list (local-file - "/home/skylar/.config/guix/home/.bash_profile" - "bash_profile"))))) - (service home-gpg-agent-service-type - (home-gpg-agent-configuration - (pinentry-program - (file-append pinentry "/bin/pinentry")) - (default-cache-ttl 86400) - (max-cache-ttl 86400) - (ssh-support? #t))) - (service home-files-service-type - `((".offlineimaprc" ,(local-file "offlineimaprc")) - (".config/rofi/config.rasi" ,(local-file "rofi.rasi")) - (".local/bin/offlineimap-pass.py" ,(local-file "offlineimap-pass.py")) - (".doom.d/config.el" ,(local-file "doom/config.el")) - (".doom.d/init.el" ,(local-file "doom/init.el")) - (".doom.d/packages.el" ,(local-file "doom/packages.el"))))))) +;; Below is the list of Home services. To search for available +;; services, run 'guix home search KEYWORD' in a terminal. +(services + (list (service home-bash-service-type + (home-bash-configuration + (aliases '(("grep" . "grep --color=auto") + ("ip" . "ip -color=auto") + ("ll" . "ls -l") + ("ls" . "ls -p --color=auto"))) + (bashrc (list (local-file + "/home/skylar/.config/guix/home/.bashrc" + "bashrc"))) + (bash-profile (list (local-file + "/home/skylar/.config/guix/home/.bash_profile" + "bash_profile"))))) + (service home-gpg-agent-service-type + (home-gpg-agent-configuration + (pinentry-program + (file-append pinentry "/bin/pinentry")) + (default-cache-ttl 86400) + (max-cache-ttl 86400) + (ssh-support? #t))) + (service home-files-service-type + `((".offlineimaprc" ,(local-file "offlineimaprc")) + (".config/rofi/config.rasi" ,(local-file "rofi.rasi")) + (".local/bin/offlineimap-pass.py" ,(local-file "offlineimap-pass.py")) + (".doom.d/config.el" ,(local-file "doom/config.el")) + (".doom.d/init.el" ,(local-file "doom/init.el")) + (".doom.d/packages.el" ,(local-file "doom/packages.el"))))))) diff --git a/sanderson.scm b/sanderson.scm index 8b564a7..09103f4 100644 --- a/sanderson.scm +++ b/sanderson.scm @@ -1,86 +1,87 @@ - (use-modules (gnu) - (nongnu packages linux) - (nongnu system linux-initrd) - (gnu packages cups) - (nongnu packages printers)) - (use-service-modules cups desktop networking ssh syncthing xorg) - (operating-system - (kernel linux) - (initrd microcode-initrd) - (firmware (list linux-firmware)) - (locale "en_US.utf8") - (timezone "America/Chicago") - (keyboard-layout (keyboard-layout "us")) - (host-name "sanderson") +(use-modules (gnu) + (nongnu packages linux) + (nongnu system linux-initrd) + (gnu packages cups) + (nongnu packages printers)) +(use-service-modules cups desktop networking ssh syncthing xorg) - ;; The list of user accounts ('root' is implicit). - (users (cons* (user-account - (name "skylar") - (comment "Skylar") - (group "users") - (home-directory "/home/skylar") - (supplementary-groups '("wheel" "netdev" "audio" "video"))) - %base-user-accounts)) +(operating-system + (kernel linux) + (initrd microcode-initrd) + (firmware (list linux-firmware)) + (locale "en_US.utf8") + (timezone "America/Chicago") + (keyboard-layout (keyboard-layout "us")) + (host-name "sanderson") - ;; Packages installed system-wide. Users can also install packages - ;; under their own account: use 'guix search KEYWORD' to search - ;; for packages and 'guix install PACKAGE' to install a package. - (packages (append (specifications->packages (list "nss-certs" - "stumpwm")) - %base-packages)) + ;; The list of user accounts ('root' is implicit). + (users (cons* (user-account + (name "skylar") + (comment "Skylar") + (group "users") + (home-directory "/home/skylar") + (supplementary-groups '("wheel" "netdev" "audio" "video"))) + %base-user-accounts)) - ;; Below is the list of system services. To search for available - ;; services, run 'guix system search KEYWORD' in a terminal. - (services - (append (list (service plasma-desktop-service-type) +;; Packages installed system-wide. Users can also install packages +;; under their own account: use 'guix search KEYWORD' to search +;; for packages and 'guix install PACKAGE' to install a package. +(packages (append (specifications->packages (list "nss-certs")) + %base-packages)) - ;; To configure OpenSSH, pass an 'openssh-configuration' - ;; record as a second argument to 'service' below. - (service openssh-service-type) - (service cups-service-type - (cups-configuration - (web-interface? #t) - (extensions - (list brlaser cups-filters epson-inkjet-printer-escpr foomatic-filters hplip hplip-plugin splix)))) - (set-xorg-configuration - (xorg-configuration (keyboard-layout keyboard-layout))) - (service syncthing-service-type - (syncthing-configuration - (user "skylar") - (home "/home/skylar"))) - (simple-service 'add-hosts - hosts-service-type - (list (host "192.168.254.167" "skylarhill.me") - (host "192.168.254.167" "vtt" - '("vtt.skylarhill.me")) - (host "192.168.254.167" "files" - '("files.skylarhill.me"))))) +;; Below is the list of system services. To search for available +;; services, run 'guix system search KEYWORD' in a terminal. +(services + (append (list (service plasma-desktop-service-type) - ;; This is the default list of services we - ;; are appending to. - (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 "./signing-key.pub")) - %default-authorized-guix-keys))))))) - (bootloader (bootloader-configuration - (bootloader grub-bootloader) - (targets (list "/dev/sda")) - (keyboard-layout keyboard-layout))) - (swap-devices (list (swap-space - (target (uuid - "646006cb-84a4-46ea-a03c-78a343b2fd07"))))) + ;; To configure OpenSSH, pass an 'openssh-configuration' + ;; record as a second argument to 'service' below. + (service openssh-service-type) + (service cups-service-type + (cups-configuration + (web-interface? #t) + (extensions + (list brlaser cups-filters epson-inkjet-printer-escpr foomatic-filters hplip hplip-plugin splix)))) + (set-xorg-configuration + (xorg-configuration (keyboard-layout keyboard-layout))) + (service syncthing-service-type + (syncthing-configuration + (user "skylar") + (home "/home/skylar"))) + (simple-service 'add-hosts + hosts-service-type + (list (host "192.168.254.167" "skylarhill.me") + (host "192.168.254.167" "vtt" + '("vtt.skylarhill.me")) + (host "192.168.254.167" "files" + '("files.skylarhill.me"))))) - ;; The list of file systems that get "mounted". The unique - ;; file system identifiers there ("UUIDs") can be obtained - ;; by running 'blkid' in a terminal. - (file-systems (cons* (file-system - (mount-point "/") - (device (uuid - "38be76dc-b7d8-4433-bab6-04c6c7f62733" - 'ext4)) - (type "ext4")) %base-file-systems))) +;; This is the default list of services we +;; are appending to. +(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 "./signing-key.pub")) + %default-authorized-guix-keys))))))) + +(bootloader (bootloader-configuration + (bootloader grub-bootloader) + (targets (list "/dev/sda")) + (keyboard-layout keyboard-layout))) +(swap-devices (list (swap-space + (target (uuid + "646006cb-84a4-46ea-a03c-78a343b2fd07"))))) + +;; The list of file systems that get "mounted". The unique +;; file system identifiers there ("UUIDs") can be obtained +;; by running 'blkid' in a terminal. +(file-systems (cons* (file-system + (mount-point "/") + (device (uuid + "38be76dc-b7d8-4433-bab6-04c6c7f62733" + 'ext4)) + (type "ext4")) %base-file-systems)))