From fec24ccac686c881cb7b2d744cc12a5b8713fa70 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Sat, 20 Jun 2026 22:41:54 +0200 Subject: [PATCH] Run guix style and remove unused code. --- Makefile | 2 +- conf/common/fonts.scm | 84 +++++++------- conf/common/local-package.scm | 31 ------ conf/common/suckless.scm | 31 +++--- conf/home/bash.scm | 63 +++++------ conf/home/desktop.scm | 29 ++--- conf/home/emacs.scm | 204 +++++++++++++++++----------------- conf/home/emoji.scm | 46 ++++---- conf/home/notify.scm | 61 +++++----- conf/home/program.scm | 27 ++--- conf/home/status-bar.scm | 105 +++++++++-------- conf/home/suckless.scm | 32 +++--- conf/home/symlink.scm | 26 ++--- conf/home/wallpaper.scm | 108 ++++++++---------- conf/home/xcompmgr.scm | 32 +++--- conf/system/bluetooth.scm | 17 ++- conf/system/desktop.scm | 77 ++++++------- conf/system/volume.scm | 47 ++++---- 18 files changed, 459 insertions(+), 563 deletions(-) delete mode 100644 conf/common/local-package.scm diff --git a/Makefile b/Makefile index f1136d0..6a0ee24 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ system-libre: tags: find $(guix-store) -wholename "*guix-$(guix-version)*.scm" -or \ -wholename "*guix-module-union*.scm" -or \ - -wholename "*guix-system-source*.scm" | xargs etags + -wholename "*guix-system-source*.scm" | xargs etags find `pwd` -name "*.scm" | xargs etags --append clean: diff --git a/conf/common/fonts.scm b/conf/common/fonts.scm index 4f73477..00ceb60 100644 --- a/conf/common/fonts.scm +++ b/conf/common/fonts.scm @@ -5,9 +5,7 @@ (define-module (conf common fonts) #:use-module (gnu packages compression) - #:use-module (gnu services) #:use-module (guix build-system trivial) - #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix licenses) #:use-module (guix packages) @@ -15,44 +13,44 @@ (define font-meslo (package - (name "font-meslo") - (version "1.2.1") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/andreberg/Meslo-Font") - (commit "c7ee3ce8fa43de2a9c99e94677ea9d1c46e56f26"))) - (sha256 - (base32 - "1594lxdk6788bb3i3c2fh74z4pwpzcp2r1xl3cz8cz77nrcjkl8m")))) - (build-system trivial-build-system) - (arguments - `(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let* ((unzip (string-append (assoc-ref %build-inputs "unzip") - "/bin/unzip")) - (ins (assoc-ref %build-inputs "source")) - (out (assoc-ref %outputs "out")) - (ver (string-append "v" ,version)) - (in-dir (string-concatenate (list ins "/dist/" ver))) - (fonts (string-append "Meslo LG " ver)) - (archive (string-concatenate (list in-dir "/" fonts))) - (out-dir (string-append out "/share/fonts")) - (file (string-append out-dir "/meslo-regular.ttf"))) - (system* unzip archive) - (mkdir-p out-dir) - (for-each (lambda (font) - (copy-file font - (string-append out-dir "/" - (basename font)))) - (find-files fonts "\\.ttf$")))))) - (native-inputs - `(("source" ,source) - ("unzip" ,unzip))) - (synopsis "Custom version of Apple’s Menlo-Regular font.") - (description "Meslo LG is a customized version of Apple’s Menlo-Regular font.") - (home-page "https://github.com/andreberg/Meslo-Font") - (license asl2.0))) + (name "font-meslo") + (version "1.2.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/andreberg/Meslo-Font") + (commit "c7ee3ce8fa43de2a9c99e94677ea9d1c46e56f26"))) + (sha256 + (base32 "1594lxdk6788bb3i3c2fh74z4pwpzcp2r1xl3cz8cz77nrcjkl8m")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) + (let* ((unzip (string-append (assoc-ref %build-inputs + "unzip") + "/bin/unzip")) + (ins (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out")) + (ver (string-append "v" + ,version)) + (in-dir (string-concatenate (list ins "/dist/" ver))) + (fonts (string-append "Meslo LG " ver)) + (archive (string-concatenate (list in-dir "/" fonts))) + (out-dir (string-append out "/share/fonts")) + (file (string-append out-dir "/meslo-regular.ttf"))) + (system* unzip archive) + (mkdir-p out-dir) + (for-each (lambda (font) + (copy-file font + (string-append out-dir "/" + (basename font)))) + (find-files fonts "\\.ttf$")))))) + (native-inputs `(("source" ,source) + ("unzip" ,unzip))) + (synopsis "Custom version of Apple’s Menlo-Regular font.") + (description + "Meslo LG is a customized version of Apple’s Menlo-Regular font.") + (home-page "https://github.com/andreberg/Meslo-Font") + (license asl2.0))) diff --git a/conf/common/local-package.scm b/conf/common/local-package.scm deleted file mode 100644 index ccbd620..0000000 --- a/conf/common/local-package.scm +++ /dev/null @@ -1,31 +0,0 @@ -;; Copyright (c) 2022-2024 Jakub Czajka -;; License: GPL-3.0 or later. -;; -;; local-package.scm - install package from local source code. - -(define-module (conf common local-package) - #:use-module (guix gexp) - #:use-module (guix packages) - #:export (local-package)) - -(define (local-package guix-package) - (define guix-package-name - (package-name guix-package)) - - (define local-package-name - (string-concatenate - (list "conf-" guix-package-name))) - - (define local-source-path - (string-concatenate - (list (getenv "GUIX_PACKAGE_PATH") "/" guix-package-name))) - - (define local-source - (local-file local-source-path - local-package-name - #:recursive? #t)) - - (package - (inherit guix-package) - (name local-package-name) - (source local-source))) diff --git a/conf/common/suckless.scm b/conf/common/suckless.scm index 5d11162..ede1f2a 100644 --- a/conf/common/suckless.scm +++ b/conf/common/suckless.scm @@ -13,21 +13,16 @@ (define libxft-bgra (package - (inherit libxft) - (name "libxft-bgra") - (version "2.3.3") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/uditkarode/libxft-bgra") - (commit "072cd202c0f4f757b32deac531586bc0429c8401"))) - (sha256 - (base32 - "1pnz43kqrd2s6q0kgxjdz0ax7a6rf7jm635whnlgq7h6q8hmv15r")))) - (inputs - (modify-inputs (package-inputs libxft) - (append autoconf - automake - libtool - m4))))) + (inherit libxft) + (name "libxft-bgra") + (version "2.3.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/uditkarode/libxft-bgra") + (commit "072cd202c0f4f757b32deac531586bc0429c8401"))) + (sha256 + (base32 "1pnz43kqrd2s6q0kgxjdz0ax7a6rf7jm635whnlgq7h6q8hmv15r")))) + (inputs (modify-inputs (package-inputs libxft) + (append autoconf automake libtool m4))))) diff --git a/conf/home/bash.scm b/conf/home/bash.scm index 9941774..eab3bd8 100644 --- a/conf/home/bash.scm +++ b/conf/home/bash.scm @@ -20,36 +20,29 @@ (define-configuration home-bash-configuration (package - (package bash) - "Packages to be installed by the service.") - (bash-profile - (string "bash/.bash_profile") - "Dotfile for login shells.") - (bashrc - (string "bash/.bashrc") - "Dotfile for interactive non-login shells.")) + (package + bash) "Packages to be installed by the service.") + (bash-profile (string "bash/.bash_profile") "Dotfile for login shells.") + (bashrc (string "bash/.bashrc") "Dotfile for interactive non-login shells.")) (define (install-bash-packages config) (list (home-bash-configuration-package config))) (define (symlink-bash-dotfiles config) - (list `(".bash_profile" - ,(local-file (home-bash-configuration-bash-profile config) - "bash_profile")) - `(".bashrc" - ,(local-file (home-bash-configuration-bashrc config) - "bashrc")))) + (list `(".bash_profile" ,(local-file (home-bash-configuration-bash-profile + config) "bash_profile")) + `(".bashrc" ,(local-file (home-bash-configuration-bashrc config) + "bashrc")))) (define home-bash-service-type - (service-type - (name 'home-bash) - (extensions - (list (service-extension home-profile-service-type - install-bash-packages) - (service-extension home-files-service-type - symlink-bash-dotfiles))) - (default-value (home-bash-configuration)) - (description "Installs bash packages and symlinks @file{.bash_profile} and + (service-type (name 'home-bash) + (extensions (list (service-extension home-profile-service-type + install-bash-packages) + (service-extension home-files-service-type + symlink-bash-dotfiles))) + (default-value (home-bash-configuration)) + (description + "Installs bash packages and symlinks @file{.bash_profile} and @file{.bashrc}."))) (define bash-service @@ -57,22 +50,18 @@ (define profile-service (service home-symlink-service-type - (list "bash/.config/profile.d/10-xdg.sh" - "bash/.config/profile.d/20-env.sh" - "bash/.config/profile.d/20-less.sh" - "bash/.config/profile.d/50-bash.sh"))) + (list "bash/.config/profile.d/10-xdg.sh" + "bash/.config/profile.d/20-env.sh" + "bash/.config/profile.d/20-less.sh" + "bash/.config/profile.d/50-bash.sh"))) + +(define xprofile-dotfiles + (list "X11/.config/X11/xbindkeysrc" "X11/.config/X11/Xresources")) (define xprofile-service (service home-program-service-type - (home-program-configuration - (packages - (list xbindkeys - xrdb)) - (dotfiles - (list "X11/.config/X11/xbindkeysrc" - "X11/.config/X11/Xresources"))))) + (home-program-configuration (packages (list xbindkeys xrdb)) + (dotfiles xprofile-dotfiles)))) (define bash-services - (list bash-service - profile-service - xprofile-service)) + (list bash-service profile-service xprofile-service)) diff --git a/conf/home/desktop.scm b/conf/home/desktop.scm index 7db4e51..94bfba7 100644 --- a/conf/home/desktop.scm +++ b/conf/home/desktop.scm @@ -4,7 +4,6 @@ ;; desktop.scm - desktop services for the home directory configuration. (define-module (conf home desktop) - #:use-module (conf home notify) #:use-module (conf home program) #:use-module (conf home status-bar) #:use-module (conf home wallpaper) @@ -13,27 +12,23 @@ #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) #:use-module (gnu services) - #:export (autorandr-service - desktop-services - screenshot-service)) + #:export (autorandr-service desktop-services screenshot-service)) + +(define autorandr-dotfiles + (list "autorandr/.config/autorandr/postswitch")) (define autorandr-service (service home-program-service-type - (home-program-configuration - (packages - (list autorandr - xrandr)) - (dotfiles - (list "autorandr/.config/autorandr/postswitch"))))) + (home-program-configuration (packages (list autorandr xrandr)) + (dotfiles autorandr-dotfiles)))) (define desktop-services - (list status-bar-service - wallpaper-service - xcompmgr-service)) + (list status-bar-service wallpaper-service xcompmgr-service)) + +(define screenshot-dotfiles + (list "bash/.config/profile.d/10-alias.sh")) (define screenshot-service (service home-program-service-type - (home-program-configuration - (packages (list flameshot)) - (dotfiles - (list "bash/.config/profile.d/10-alias.sh"))))) + (home-program-configuration (packages (list flameshot)) + (dotfiles screenshot-dotfiles)))) diff --git a/conf/home/emacs.scm b/conf/home/emacs.scm index bc3b13f..9345a85 100644 --- a/conf/home/emacs.scm +++ b/conf/home/emacs.scm @@ -5,13 +5,11 @@ (define-module (conf home emacs) #:use-module (conf home program) - #:use-module (gnu home services) #:use-module (gnu home services shepherd) #:use-module (gnu packages aspell) #:use-module (gnu packages base) #:use-module (gnu packages curl) #:use-module (gnu packages emacs) - #:use-module (gnu packages emacs-xyz) #:use-module (gnu packages freedesktop) #:use-module (gnu packages gnupg) #:use-module (gnu packages linux) @@ -26,164 +24,162 @@ #:use-module (guix gexp) #:export (emacs-services)) +(define emacs-batch-edit-dotfiles + (list "emacs/.config/emacs/conf/conf-batch-edit.el")) + (define emacs-batch-edit-service (service home-program-service-type - (home-program-configuration - (packages '()) - (dotfiles - (list "emacs/.config/emacs/conf/conf-batch-edit.el"))))) + (home-program-configuration (packages '()) + (dotfiles emacs-batch-edit-dotfiles)))) + +(define emacs-calfw-dotfiles + (list "emacs/.config/emacs/conf/conf-calendar.el")) (define emacs-calfw-service (service home-program-service-type - (home-program-configuration - (packages - (list binutils)) - (dotfiles - (list "emacs/.config/emacs/conf/conf-calendar.el"))))) + (home-program-configuration (packages (list binutils)) + (dotfiles emacs-calfw-dotfiles)))) + +(define emacs-consult-dotfiles + (list "emacs/.config/emacs/conf/conf-consult.el")) (define emacs-consult-service (service home-program-service-type - (home-program-configuration - (packages - (list ripgrep)) - (dotfiles - (list "emacs/.config/emacs/conf/conf-consult.el"))))) + (home-program-configuration (packages (list ripgrep)) + (dotfiles emacs-consult-dotfiles)))) (define emacs-daemon-shepherd-service - (shepherd-service - (provision '(emacs)) - (start #~(make-forkexec-constructor - (list "emacs" "--fg-daemon") - #:directory (getenv "HOME"))) - (stop #~(make-kill-destructor)) - (documentation ""))) + (shepherd-service (provision '(emacs)) + (start #~(make-forkexec-constructor (list "emacs" + "--fg-daemon") + #:directory (getenv + "HOME"))) + (stop #~(make-kill-destructor)) + (documentation ""))) (define emacs-daemon-service - (simple-service 'emacs-daemon-service - home-shepherd-service-type + (simple-service 'emacs-daemon-service home-shepherd-service-type (list emacs-daemon-shepherd-service))) +(define emacs-dired-dotfiles + (list "mime/.config/mimeapps.list" "emacs/.config/emacs/conf/conf-dired.el")) + (define emacs-dired-service (service home-program-service-type (home-program-configuration ;; file - (packages - (list xdg-utils)) - (dotfiles - (list "mime/.config/mimeapps.list" - "emacs/.config/emacs/conf/conf-dired.el"))))) + (packages (list xdg-utils)) + (dotfiles emacs-dired-dotfiles)))) + +(define emacs-document-dotfiles + (list "emacs/.config/emacs/conf/conf-document.el")) (define emacs-document-service (service home-program-service-type (home-program-configuration ;; libpng cairo autoconf automake gcc pkg-config - (packages - (list poppler)) - (dotfiles - (list "emacs/.config/emacs/conf/conf-document.el"))))) + (packages (list poppler)) + (dotfiles emacs-document-dotfiles)))) + +(define emacs-email-dotfiles + (list "bash/.config/profile.d/50-notmuch.sh" + "emacs/.config/emacs/conf/conf-email.el" + "email/.local/mail/.hooks/pre-new")) (define emacs-email-service (service home-program-service-type - (home-program-configuration - (packages - (list isync - msmtp)) - (dotfiles - (list "bash/.config/profile.d/50-notmuch.sh" - "emacs/.config/emacs/conf/conf-email.el" - "email/.local/mail/.hooks/pre-new"))))) + (home-program-configuration (packages (list isync msmtp)) + (dotfiles emacs-email-dotfiles)))) + +(define emacs-keys-dotfiles + (list "emacs/.config/emacs/conf/conf-keys.el")) (define emacs-keys-service (service home-program-service-type - (home-program-configuration - (packages '()) - (dotfiles - (list "emacs/.config/emacs/conf/conf-keys.el"))))) + (home-program-configuration (packages '()) + (dotfiles emacs-keys-dotfiles)))) + +(define emacs-language-dotfiles + (list "emacs/.config/emacs/conf/conf-language.el")) (define emacs-language-service (service home-program-service-type - (home-program-configuration - (packages - (list aspell - aspell-dict-en)) - (dotfiles - (list "emacs/.config/emacs/conf/conf-language.el"))))) + (home-program-configuration (packages (list aspell aspell-dict-en)) + (dotfiles emacs-language-dotfiles)))) + +(define emacs-minibuffer-dotfiles + (list "emacs/.config/emacs/conf/conf-minibuffer.el")) (define emacs-minibuffer-service (service home-program-service-type - (home-program-configuration - (packages '()) - (dotfiles - (list "emacs/.config/emacs/conf/conf-minibuffer.el"))))) + (home-program-configuration (packages '()) + (dotfiles emacs-minibuffer-dotfiles)))) + +(define emacs-music-dotfiles + (list "bash/.config/profile.d/50-alsa.sh" + "bash/.config/profile.d/50-mplayer.sh" + "emacs/.config/emacs/conf/conf-music.el")) (define emacs-music-service (service home-program-service-type - (home-program-configuration - (packages - (list alsa-utils - mplayer)) - (dotfiles - (list "bash/.config/profile.d/50-alsa.sh" - "bash/.config/profile.d/50-mplayer.sh" - "emacs/.config/emacs/conf/conf-music.el"))))) + (home-program-configuration (packages (list alsa-utils mplayer)) + (dotfiles emacs-music-dotfiles)))) + +(define emacs-org-dotfiles + (list "emacs/.config/emacs/conf/conf-org.el")) (define emacs-org-service (service home-program-service-type - (home-program-configuration - (packages - (list sqlite)) - (dotfiles - (list "emacs/.config/emacs/conf/conf-org.el"))))) + (home-program-configuration (packages (list sqlite)) + (dotfiles emacs-org-dotfiles)))) + +(define emacs-package-dotfiles + (list "emacs/.config/emacs/conf/conf-package.el")) (define emacs-package-service (service home-program-service-type - (home-program-configuration - (packages '()) - (dotfiles - (list "emacs/.config/emacs/conf/conf-package.el"))))) + (home-program-configuration (packages '()) + (dotfiles emacs-package-dotfiles)))) + +(define emacs-pass-dotfiles + (list "bash/.config/profile.d/50-gpg.sh" "bash/.config/profile.d/50-pass.sh" + "emacs/.config/emacs/conf/conf-crypt.el")) (define emacs-pass-service (service home-program-service-type - (home-program-configuration - (packages - (list gnupg - password-store - pinentry)) - (dotfiles - (list "bash/.config/profile.d/50-gpg.sh" - "bash/.config/profile.d/50-pass.sh" - "emacs/.config/emacs/conf/conf-crypt.el"))))) + (home-program-configuration (packages (list gnupg password-store + pinentry)) + (dotfiles emacs-pass-dotfiles)))) + +(define emacs-rss-dotfiles + (list "emacs/.config/emacs/conf/conf-rss.el")) (define emacs-rss-service (service home-program-service-type - (home-program-configuration - (packages - (list curl)) - (dotfiles - (list "emacs/.config/emacs/conf/conf-rss.el"))))) + (home-program-configuration (packages (list curl)) + (dotfiles emacs-rss-dotfiles)))) + +(define emacs-dotfiles + (list "emacs/.config/emacs/init.el" + "emacs/.config/emacs/conf/conf-emacs.el" + "emacs/.config/emacs/conf/conf-lisp.el" + "emacs/.config/emacs/conf/conf-theme.el" + "emacs/.config/emacs/conf/conf-variables.el" + "emacs/.config/emacs/conf/conf-web.el" + "emacs/.local/bin/emacs_client")) (define emacs-service (service home-program-service-type - (home-program-configuration - (packages - (list emacs)) - (dotfiles - (list "emacs/.config/emacs/init.el" - "emacs/.config/emacs/conf/conf-emacs.el" - "emacs/.config/emacs/conf/conf-lisp.el" - "emacs/.config/emacs/conf/conf-theme.el" - "emacs/.config/emacs/conf/conf-variables.el" - "emacs/.config/emacs/conf/conf-web.el" - "emacs/.local/bin/emacs_client"))))) + (home-program-configuration (packages (list emacs)) + (dotfiles emacs-dotfiles)))) + +(define emacs-vc-dotfiles + (list "git/.config/git/config" "emacs/.config/emacs/conf/conf-vc.el")) (define emacs-vc-service (service home-program-service-type - (home-program-configuration - (packages - (list git)) - (dotfiles - (list "git/.config/git/config" - "emacs/.config/emacs/conf/conf-vc.el"))))) + (home-program-configuration (packages (list git)) + (dotfiles emacs-vc-dotfiles)))) (define emacs-services (list emacs-batch-edit-service diff --git a/conf/home/emoji.scm b/conf/home/emoji.scm index e3585fa..df29492 100644 --- a/conf/home/emoji.scm +++ b/conf/home/emoji.scm @@ -12,29 +12,27 @@ (define select-emoji (package - (name "select-emoji") - (version "1.0") - (source - (local-file - (string-concatenate - (list (getenv "GUIX_PACKAGE_PATH") - "/scripts/select_emoji")))) - (build-system trivial-build-system) - (arguments - '(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) + (name "select-emoji") + (version "1.0") + (source + (local-file (canonicalize-path (string-append (getenv "GUIX_PACKAGE_PATH") + "/scripts/select_emoji")))) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) - (let* ((ins (assoc-ref %build-inputs "source")) - (out (assoc-ref %outputs "out")) - (dir (string-concatenate (list out "/bin"))) - (file (string-append dir "/select_emoji"))) - (mkdir-p dir) - (copy-file ins file) - (chmod file #o555))))) - (synopsis "Script for copying emojis to the clipboard through dmenu.") - (description "`select_emoji` displays a list of emojis with dmenu and copies + (let* ((ins (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out")) + (dir (string-concatenate (list out "/bin"))) + (file (string-append dir "/select_emoji"))) + (mkdir-p dir) + (copy-file ins file) + (chmod file #o555))))) + (synopsis "Script for copying emojis to the clipboard through dmenu.") + (description + "`select_emoji` displays a list of emojis with dmenu and copies the selection to the clipboard.") - (home-page "https://git.ekhem.eu.org") - (license gpl3+))) + (home-page "https://git.ekhem.eu.org") + (license gpl3+))) diff --git a/conf/home/notify.scm b/conf/home/notify.scm index f6b890a..912df78 100644 --- a/conf/home/notify.scm +++ b/conf/home/notify.scm @@ -12,35 +12,31 @@ #:use-module (guix gexp) #:use-module (guix records) #:use-module (ice-9 match) - #:export (dunst-configuration - dunst-configuration? - dunst-configuration-package - dunst-configuration-config-file - notify-service - notify-service-type)) + #:export (notify-service)) -(define-record-type* - dunst-configuration make-dunst-configuration +(define-record-type* dunst-configuration + make-dunst-configuration dunst-configuration? - (package dunst-configuration-package - (default dunst)) + (package + dunst-configuration-package + (default dunst)) (config-file dunst-configuration-config-file (default "dunst/.config/dunst/dunstrc"))) (define dunst-shepherd-service (match-lambda - (($ package config-file) - (shepherd-service - (provision '(notify)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/bin/dunst")) - #:directory - (getenv "HOME") - #:log-file - (string-append (getenv "HOME") - "/.local/var/log/dunst.log"))) - (stop #~(make-kill-destructor)) - (documentation ""))))) + (($ package config-file) + (shepherd-service (provision '(notify)) + (start #~(let* ((home (getenv "HOME")) + (prog #$(file-append package + "/bin/dunst")) + (log (string-append home + "/.local/var/log/dunst.log"))) + (make-forkexec-constructor (list prog) + #:directory home + #:log-file log))) + (stop #~(make-kill-destructor)) + (documentation ""))))) (define (install-dunst config) (list (dunst-configuration-package config))) @@ -49,17 +45,16 @@ (list (dunst-configuration-config-file config))) (define notify-service-type - (service-type - (name 'notify) - (extensions - (list (service-extension home-shepherd-service-type - (compose list dunst-shepherd-service)) - (service-extension home-profile-service-type - install-dunst) - (service-extension home-symlink-service-type - symlink-dunst-config-file))) - (default-value (dunst-configuration)) - (description ""))) + (service-type (name 'notify) + (extensions (list (service-extension + home-shepherd-service-type + (compose list dunst-shepherd-service)) + (service-extension home-profile-service-type + install-dunst) + (service-extension home-symlink-service-type + symlink-dunst-config-file))) + (default-value (dunst-configuration)) + (description ""))) (define notify-service (service notify-service-type)) diff --git a/conf/home/program.scm b/conf/home/program.scm index 451c245..b527ebf 100644 --- a/conf/home/program.scm +++ b/conf/home/program.scm @@ -7,24 +7,21 @@ #:use-module (conf home symlink) #:use-module (gnu home services) #:use-module (gnu services configuration) + #:use-module (guix gexp) #:use-module (guix packages) - #:export (home-program-configuration - home-program-service-type)) + #:export (home-program-configuration home-program-service-type)) (define (packages? ps) (or (null? ps) - (and (package? (car ps)) (packages? (cdr ps))))) + (and (package? (car ps)) + (packages? (cdr ps))))) (define (serialize-packages field-name value) #~(#$@value)) (define-configuration home-program-configuration - (packages - (packages) - "List of packages of the service to install.") - (dotfiles - (text-config '()) - "List of dotfiles of the service to symlink.")) + (packages (packages) "List of packages of the service to install.") + (dotfiles (text-config '()) "List of dotfiles of the service to symlink.")) (define (install-packages config) (home-program-configuration-packages config)) @@ -34,10 +31,8 @@ (define home-program-service-type (service-type (name 'home-program) - (extensions - (list - (service-extension home-profile-service-type - install-packages) - (service-extension home-symlink-service-type - symlink-dotfiles))) - (description "Installs programs and symlinks dotfiles."))) + (extensions (list (service-extension home-profile-service-type + install-packages) + (service-extension home-symlink-service-type + symlink-dotfiles))) + (description "Installs programs and symlinks dotfiles."))) diff --git a/conf/home/status-bar.scm b/conf/home/status-bar.scm index fde3422..76de348 100644 --- a/conf/home/status-bar.scm +++ b/conf/home/status-bar.scm @@ -18,73 +18,70 @@ #:use-module (guix packages) #:use-module (guix records) #:use-module (ice-9 match) - #:export (status-bar - status-bar-configuration - status-bar-configuration? - status-bar-configuration-package - status-bar-service - status-bar-service-type)) + #:export (status-bar-service)) (define status-bar (package - (name "status-bar") - (version "1.0") - (source - (local-file - (string-concatenate - (list (getenv "GUIX_PACKAGE_PATH") - "/scripts/status_bar")))) - (build-system trivial-build-system) - (arguments - '(#:builder - (begin - (let* ((ins (assoc-ref %build-inputs "source")) - (out (assoc-ref %outputs "out")) - (file (string-append out "/status_bar"))) - (mkdir out) - (copy-file ins file) - (chmod file #o555))))) - (synopsis "Script which generates a status bar.") - (description "`status-bar` is a shell script which repeatedly prints a status + (name "status-bar") + (version "1.0") + (source + (local-file (canonicalize-path (string-append (getenv "GUIX_PACKAGE_PATH") + "/scripts/status_bar")))) + (build-system trivial-build-system) + (arguments + '(#:builder (begin + (let* ((ins (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out")) + (file (string-append out "/status_bar"))) + (mkdir out) + (copy-file ins file) + (chmod file #o555))))) + (synopsis "Script which generates a status bar.") + (description + "`status-bar` is a shell script which repeatedly prints a status bar. The output should be redirected to the desktop.") - (home-page "https://git.ekhem.eu.org") - (license gpl3+))) + (home-page "https://git.ekhem.eu.org") + (license gpl3+))) -(define-record-type* - status-bar-configuration make-status-bar-configuration +(define-record-type* status-bar-configuration + make-status-bar-configuration status-bar-configuration? - (package status-bar-configuration-package - (default status-bar))) + (package + status-bar-configuration-package + (default status-bar))) (define status-bar-shepherd-service (match-lambda - (($ package) - (shepherd-service - (provision '(status-bar)) - (start #~(make-forkexec-constructor - (list #$(file-append package "/status_bar")) - #:directory - (getenv "HOME") - #:log-file - (string-append (getenv "HOME") - "/.local/var/log/status_bar.log"))) - (stop #~(make-kill-destructor)) - (documentation ""))))) + (($ package) + (shepherd-service (provision '(status-bar)) + (start #~(let* ((home (getenv "HOME")) + (prog #$(file-append package + "/status_bar")) + (log (string-append home + "/.local/var/log/status_bar.log"))) + (make-forkexec-constructor (list prog) + #:directory home + #:log-file log))) + (stop #~(make-kill-destructor)) + (documentation ""))))) (define (install-status-bar-dependencies config) - (list alsa-utils gawk notmuch sed xclip xsetroot)) + (list alsa-utils + gawk + notmuch + sed + xclip + xsetroot)) (define status-bar-service-type - (service-type - (name 'status-bar-service) - (extensions - (list (service-extension home-profile-service-type - install-status-bar-dependencies) - (service-extension home-shepherd-service-type - (compose list - status-bar-shepherd-service)))) - (default-value (status-bar-configuration)) - (description "Shepherd service for the `status-bar`."))) + (service-type (name 'status-bar-service) + (extensions (list (service-extension home-profile-service-type + install-status-bar-dependencies) + (service-extension + home-shepherd-service-type + (compose list status-bar-shepherd-service)))) + (default-value (status-bar-configuration)) + (description "Shepherd service for the `status-bar`."))) (define status-bar-service (service status-bar-service-type)) diff --git a/conf/home/suckless.scm b/conf/home/suckless.scm index 07ac89f..0c07766 100644 --- a/conf/home/suckless.scm +++ b/conf/home/suckless.scm @@ -1,8 +1,8 @@ ;; Copyright (c) 2022-2024 Jakub Czajka ;; License: GPL-3.0 or later. ;; -;; suckless.scm - packages with custom versions of suckless software. Source code -;; is obtainted from self-hosted repositories. +;; suckless.scm - packages with custom versions of suckless software. Source +;; code is obtained from self-hosted repositories. (define-module (conf home suckless) #:use-module (conf common suckless) @@ -13,18 +13,16 @@ (define st-libxft-bgra (package - (inherit st) - (name "st-bgra") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://git.ekhem.eu.org/st.git") - (commit "542df2882a55076baad1c5685b843ebed2d94939"))) - (sha256 - (base32 - "1l0ch3sm3nwp3q3zkrhbwn45q5f3w8bzl9j7nvmsjmwd1nl4jfxh")))) - (inputs - (modify-inputs (package-inputs st) - (delete "libxft") - (append libxft-bgra))))) + (inherit st) + (name "st-bgra") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.ekhem.eu.org/st.git") + (commit "542df2882a55076baad1c5685b843ebed2d94939"))) + (sha256 + (base32 "1l0ch3sm3nwp3q3zkrhbwn45q5f3w8bzl9j7nvmsjmwd1nl4jfxh")))) + (inputs (modify-inputs (package-inputs st) + (delete "libxft") + (append libxft-bgra))))) diff --git a/conf/home/symlink.scm b/conf/home/symlink.scm index 49b4f58..2be99fc 100644 --- a/conf/home/symlink.scm +++ b/conf/home/symlink.scm @@ -5,36 +5,34 @@ (define-module (conf home symlink) #:use-module (gnu home services) - #:use-module (gnu services configuration) #:use-module (guix gexp) - #:use-module (guix packages) #:use-module (srfi srfi-1) #:export (home-symlink-service-type)) (define (symlink paths) (define (conf-home file) - (string-concatenate - (list (getenv "GUIX_PACKAGE_PATH") "/" file))) + (string-concatenate (list (getenv "GUIX_PACKAGE_PATH") "/" file))) (define (make-symlink-pair path) (let* ((conf-path (conf-home path)) - (file (local-file conf-path #:recursive? #t)) - (first-slash (string-index path #\/))) + (file (local-file conf-path + #:recursive? #t)) + (first-slash (string-index path #\/))) (if first-slash - (list (substring path (+ first-slash 1)) - file) - (list path file)))) + (list (substring path + (+ first-slash 1)) file) + (list path file)))) (map make-symlink-pair paths)) (define home-symlink-service-type (service-type (name 'home-profile) - (extensions - (list (service-extension home-files-service-type - symlink))) + (extensions (list (service-extension home-files-service-type + symlink))) (compose concatenate) (extend append) - (default-value '()) - (description "Copies files to the guix store and symlinks them in + (default-value '()) + (description + "Copies files to the guix store and symlinks them in the home directory. For a @path{a/b/c/d.ext}, creates a @file{d.ext} file in the guix store and symlinks it as @file{~/b/c/d.ext}."))) diff --git a/conf/home/wallpaper.scm b/conf/home/wallpaper.scm index ad07616..89f9776 100644 --- a/conf/home/wallpaper.scm +++ b/conf/home/wallpaper.scm @@ -13,79 +13,69 @@ #:use-module (guix packages) #:use-module (guix records) #:use-module (ice-9 match) - #:export (wallpaper - wallpaper-configuration - wallpaper-configuration? - wallpaper-configuration-package - wallpaper-service - wallpaper-service-type)) + #:export (wallpaper-service)) (define wallpaper (package - (name "wallpaper") - (version "1.0") - (source - (local-file - (string-concatenate - (list (getenv "GUIX_PACKAGE_PATH") - "/scripts/wallpaper")))) - (build-system trivial-build-system) - (arguments - '(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) + (name "wallpaper") + (version "1.0") + (source + (local-file (canonicalize-path (string-append (getenv "GUIX_PACKAGE_PATH") + "/scripts/wallpaper")))) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) - (let* ((ins (assoc-ref %build-inputs "source")) - (out (assoc-ref %outputs "out")) - (dir (string-concatenate (list out "/bin"))) - (file (string-append dir "/wallpaper"))) - (mkdir-p dir) - (copy-file ins file) - (chmod file #o555))))) - (synopsis "Set an image as wallpaper.") - (description "`wallpaper` gets a path to an image as an arguments and sets + (let* ((ins (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out")) + (dir (string-concatenate (list out "/bin"))) + (file (string-append dir "/wallpaper"))) + (mkdir-p dir) + (copy-file ins file) + (chmod file #o555))))) + (synopsis "Set an image as wallpaper.") + (description "`wallpaper` gets a path to an image as an arguments and sets this image as the system's wallpaper.") - (home-page "https://git.ekhem.eu.org") - (license gpl3+))) + (home-page "https://git.ekhem.eu.org") + (license gpl3+))) -(define-record-type* - wallpaper-configuration make-wallpaper-configuration +(define-record-type* wallpaper-configuration + make-wallpaper-configuration wallpaper-configuration? - (package wallpaper-configuration-package - (default wallpaper))) + (package + wallpaper-configuration-package + (default wallpaper))) (define wallpaper-shepherd-service (match-lambda - (($ package) - (shepherd-service - (provision '(wallpaper)) - (respawn? #f) - (start #~(make-forkexec-constructor - (list #$(file-append package "/bin/wallpaper")) - #:directory - (getenv "HOME") - #:log-file - (string-append (getenv "HOME") - "/.local/var/log/wallpaper.log"))) - (stop #~(make-kill-destructor)) - (documentation ""))))) + (($ package) + (shepherd-service (provision '(wallpaper)) + (respawn? #f) + (start #~(let* ((home (getenv "HOME")) + (prog #$(file-append package + "/bin/wallpaper")) + (log (string-append home + "/.local/var/log/wallpaper.log"))) + (make-forkexec-constructor (list prog) + #:directory home + #:log-file log))) + (stop #~(make-kill-destructor)) + (documentation ""))))) (define (install-wallpaper config) - (list (wallpaper-configuration-package config) - feh)) + (list (wallpaper-configuration-package config) feh)) (define wallpaper-service-type - (service-type - (name 'wallpaper-service) - (extensions - (list (service-extension home-profile-service-type - install-wallpaper) - (service-extension home-shepherd-service-type - (compose list - wallpaper-shepherd-service)))) - (default-value (wallpaper-configuration)) - (description "Shepherd service to run `wallpaper` once."))) + (service-type (name 'wallpaper-service) + (extensions (list (service-extension home-profile-service-type + install-wallpaper) + (service-extension + home-shepherd-service-type + (compose list wallpaper-shepherd-service)))) + (default-value (wallpaper-configuration)) + (description "Shepherd service to run `wallpaper` once."))) (define wallpaper-service (service wallpaper-service-type)) diff --git a/conf/home/xcompmgr.scm b/conf/home/xcompmgr.scm index 206b0ba..be0fad5 100644 --- a/conf/home/xcompmgr.scm +++ b/conf/home/xcompmgr.scm @@ -8,25 +8,23 @@ #:use-module (gnu packages xorg) #:use-module (gnu services) #:use-module (guix gexp) - #:use-module (guix licenses) - #:use-module (guix packages) #:export (xcompmgr-service)) (define xcompmgr-shepherd-service - (shepherd-service - (provision '(xcompmgr)) - (start #~(make-forkexec-constructor - (list #$(file-append xcompmgr "/bin/xcompmgr")) - #:directory - (getenv "HOME") - #:log-file - (string-append (getenv "HOME") - "/.local/var/log/xcompmgr.log"))) - (stop #~(make-kill-destructor)) - (documentation "Shepherd service which runs `xcompmgr` - a simple -compositor."))) + (shepherd-service (provision '(xcompmgr)) + (start #~(let* ((home (getenv "HOME")) + (prog #$(file-append xcompmgr + "/bin/xcompmgr")) + (log (string-append home + "/.local/var/log/xcompmgr.log"))) + (make-forkexec-constructor (list prog) + #:directory home + #:log-file log))) + (stop #~(make-kill-destructor)) + (documentation (string-append + "Shepherd service which runs `xcompmgr'" + " - a simple compositor.")))) (define xcompmgr-service - (simple-service 'xcompmgr-service - home-shepherd-service-type - (list xcompmgr-shepherd-service))) + (simple-service 'xcompmgr-service home-shepherd-service-type + (list xcompmgr-shepherd-service))) diff --git a/conf/system/bluetooth.scm b/conf/system/bluetooth.scm index 6c7aa4f..e81f339 100644 --- a/conf/system/bluetooth.scm +++ b/conf/system/bluetooth.scm @@ -7,21 +7,18 @@ #:use-module (gnu packages linux) #:use-module (gnu services) #:use-module (gnu services desktop) - #:export (bluez-service - bluez-service-type)) + #:export (bluez-service)) (define (install-bluez config) (list bluez)) (define bluez-service-type - (service-type - (inherit bluetooth-service-type) - (name 'bluez) - (extensions - (append - (list (service-extension profile-service-type - install-bluez)) - (service-type-extensions bluetooth-service-type))))) + (service-type (inherit bluetooth-service-type) + (name 'bluez) + (extensions (append (list (service-extension + profile-service-type install-bluez)) + (service-type-extensions + bluetooth-service-type))))) (define bluez-service (service bluez-service-type)) diff --git a/conf/system/desktop.scm b/conf/system/desktop.scm index 3e0e928..1bc9aad 100644 --- a/conf/system/desktop.scm +++ b/conf/system/desktop.scm @@ -8,7 +8,8 @@ #:use-module (conf common suckless) #:use-module (gnu packages fonts) #:use-module (gnu packages suckless) - #:use-module (gnu services) + #:use-module ((gnu services) + #:hide (delete)) ;Prevent overriding core delete. #:use-module (gnu services desktop) #:use-module (gnu services networking) #:use-module (gnu services xorg) @@ -16,51 +17,45 @@ #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix packages) - #:export (dwm-desktop-packages %custom-desktop-services - %gdm-wayland-disabled %resolv-conf-service + #:export (dwm-desktop-packages %custom-desktop-services %resolv-conf-service keyboard-layout-service)) (define dmenu-libxft-bgra (package - (inherit dmenu) - (name "dmenu-bgra") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://git.ekhem.eu.org/dmenu.git") - (commit "2a0284e7aad49b0aec8760c9433237ad73affefd"))) - (sha256 - (base32 - "0vcwnjwh80vdwsbcdww3j8v6wr2d4lil9q580nj1fz1y4zsqbfwz")))) - (inputs - (modify-inputs (package-inputs dmenu) - (delete "libxft") - (append libxft-bgra))))) + (inherit dmenu) + (name "dmenu-bgra") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.ekhem.eu.org/dmenu.git") + (commit "2a0284e7aad49b0aec8760c9433237ad73affefd"))) + (sha256 + (base32 "0vcwnjwh80vdwsbcdww3j8v6wr2d4lil9q580nj1fz1y4zsqbfwz")))) + (inputs (modify-inputs (package-inputs dmenu) + (delete "libxft") + (append libxft-bgra))))) (define dwm-libxft-bgra (package - (inherit dwm) - (name "dwm-bgra") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://git.ekhem.eu.org/dwm.git") - (commit "3515a61426664d065c30a1e04d83b8fc19bf7a23"))) - (sha256 - (base32 - "0qwyw12blql48aw4m7z9j96ic9215dpx0ifr0qc8rk10xkh9garf")))) - (inputs - (modify-inputs (package-inputs dwm) - (delete "libxft") - (append libxft-bgra))))) + (inherit dwm) + (name "dwm-bgra") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.ekhem.eu.org/dwm.git") + (commit "3515a61426664d065c30a1e04d83b8fc19bf7a23"))) + (sha256 + (base32 "0qwyw12blql48aw4m7z9j96ic9215dpx0ifr0qc8rk10xkh9garf")))) + (inputs (modify-inputs (package-inputs dwm) + (delete "libxft") + (append libxft-bgra))))) (define keyboard-layout-service (set-xorg-configuration - (xorg-configuration - (keyboard-layout - (keyboard-layout "pl"))))) + (xorg-configuration (keyboard-layout (keyboard-layout "pl"))))) + (define %gdm-wayland-disabled (gdm-configuration (inherit (gdm-configuration)) (wayland? #f))) @@ -75,8 +70,9 @@ (define %resolv-conf-service (let* ((guix-path (getenv "GUIX_PACKAGE_PATH")) - (resolv-conf (local-file (string-append guix-path - "/dns/etc/resolv.conf"))) + (resolv-path (canonicalize-path (string-append guix-path + "/dns/etc/resolv.conf"))) + (resolv-conf (local-file resolv-path)) (etc-files (list `("resolv.conf" ,resolv-conf)))) (simple-service 'resolv etc-service-type etc-files))) @@ -86,7 +82,4 @@ (network-manager-service-type config => %network-manager-encrypted-dns))) (define dwm-desktop-packages - (list dmenu-libxft-bgra - dwm-libxft-bgra - font-google-noto-emoji - font-meslo)) + (list dmenu-libxft-bgra dwm-libxft-bgra font-google-noto-emoji font-meslo)) diff --git a/conf/system/volume.scm b/conf/system/volume.scm index 5aa101e..bab4c92 100644 --- a/conf/system/volume.scm +++ b/conf/system/volume.scm @@ -4,8 +4,6 @@ ;; volume.scm - package for controling system's volume. (define-module (conf system volume) - #:use-module (gnu packages linux) - #:use-module (gnu services) #:use-module (guix build-system trivial) #:use-module (guix gexp) #:use-module (guix licenses) @@ -14,28 +12,25 @@ (define volume (package - (name "volume") - (version "1.0") - (source - (local-file - (string-concatenate - (list (getenv "GUIX_PACKAGE_PATH") - "/scripts/volume")))) - (build-system trivial-build-system) - (arguments - '(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) + (name "volume") + (version "1.0") + (source + (local-file (canonicalize-path (string-append (getenv "GUIX_PACKAGE_PATH") + "/scripts/volume")))) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) - (let* ((ins (assoc-ref %build-inputs "source")) - (out (assoc-ref %outputs "out")) - (dir (string-concatenate (list out "/bin"))) - (file (string-append dir "/volume"))) - (mkdir-p dir) - (copy-file ins file) - (chmod file #o555))))) - (synopsis "Script for controlling the volume level.") - (description "Wraps a scripts which can control system's volume level.") - (home-page "https://git.ekhem.eu.org") - (license gpl3+))) + (let* ((ins (assoc-ref %build-inputs "source")) + (out (assoc-ref %outputs "out")) + (dir (string-concatenate (list out "/bin"))) + (file (string-append dir "/volume"))) + (mkdir-p dir) + (copy-file ins file) + (chmod file #o555))))) + (synopsis "Script for controlling the volume level.") + (description "Wraps a scripts which can control system's volume level.") + (home-page "https://git.ekhem.eu.org") + (license gpl3+))) -- 2.47.3