diff --git a/.dir-locals.el b/.dir-locals.el index daed803..4fae662 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -52,7 +52,9 @@ (eval . (put 'cuirass-worker-container-configuration 'scheme-indent-function 0)) (eval . (put 'docker-mailserver-configuration 'scheme-indent-function 0)) (eval . (put 'forgejo-configuration 'scheme-indent-function 0)) + (eval . (put 'home-atuin-configuration 'scheme-indent-function 0)) (eval . (put 'home-blueman-applet-configuration 'scheme-indent-function 0)) + (eval . (put 'home-direnv-configuration 'scheme-indent-function 0)) (eval . (put 'home-fcitx5-configuration 'scheme-indent-function 0)) (eval . (put 'home-mako-configuration 'scheme-indent-function 0)) (eval . (put 'home-network-manager-applet-configuration 'scheme-indent-function 0)) @@ -64,6 +66,7 @@ (eval . (put 'home-theme-configuration 'scheme-indent-function 0)) (eval . (put 'home-wakapi-configuration 'scheme-indent-function 0)) (eval . (put 'home-waybar-configuration 'scheme-indent-function 0)) + (eval . (put 'home-zoxide-configuration 'scheme-indent-function 0)) (eval . (put 'iwd-configuration 'scheme-indent-function 0)) (eval . (put 'jellyfin-configuration 'scheme-indent-function 0)) (eval . (put 'komga-configuration 'scheme-indent-function 0)) diff --git a/modules/rosenthal/services/shellutils.scm b/modules/rosenthal/services/shellutils.scm new file mode 100644 index 0000000..87587c9 --- /dev/null +++ b/modules/rosenthal/services/shellutils.scm @@ -0,0 +1,128 @@ +;;; SPDX-FileCopyrightText: 2025 Hilton Chain +;;; +;;; SPDX-License-Identifier: GPL-3.0-or-later + +(define-module (rosenthal services shellutils) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + + #:use-module (guix gexp) + #:use-module (guix records) + + #:use-module (gnu services) + #:use-module (gnu services configuration) + + #:use-module (gnu home services shells) + + #:use-module (rosenthal packages rust-apps) + + #:export (home-atuin-configuration + home-atuin-service-type + + home-direnv-configuration + home-direnv-service-type + + home-zoxide-configuration + home-zoxide-service-type)) + +(define (shells? val) + (every (cut member <> '(bash zsh fish)) + val)) + +;;; +;;; atuin +;;; + +(define-configuration/no-serialization home-atuin-configuration + (atuin + (file-like atuin) + "") + (shells + shells + "")) + +(define %home-atuin-fish + (match-record-lambda + (atuin shells) + (if (member 'fish shells) + (home-fish-extension + (config + (list (mixed-text-file "atuin.fish" + atuin "/bin/atuin init fish | source\n"))))))) + +(define home-atuin-service-type + (service-type + (name 'atuin) + (extensions + `(,@(if %home-atuin-fish + (list (service-extension home-fish-service-type + %home-atuin-fish)) + + '()))) + (description ""))) + + +;;; +;;; direnv +;;; + +(define-configuration/no-serialization home-direnv-configuration + (direnv + (file-like (spec->pkg "direnv")) + "") + (shells + shells + "")) + +(define %home-direnv-fish + (match-record-lambda + (direnv shells) + (if (member 'fish shells) + (home-fish-extension + (config + (list (mixed-text-file "direnv.fish" + direnv "/bin/direnv hook fish | source\n"))))))) + +(define home-direnv-service-type + (service-type + (name 'direnv) + (extensions + `(,@(if %home-direnv-fish + (list (service-extension home-fish-service-type + %home-direnv-fish)) + + '()))) + (description ""))) + + +;;; +;;; zoxide +;;; + +(define-configuration/no-serialization home-zoxide-configuration + (zoxide + (file-like (spec->pkg "zoxide")) + "") + (shells + shells + "")) + +(define %home-zoxide-fish + (match-record-lambda + (zoxide shells) + (if (member 'fish shells) + (home-fish-extension + (config + (list (mixed-text-file "zoxide.fish" + zoxide "/bin/zoxide init --cmd cd fish | source\n"))))))) + +(define home-zoxide-service-type + (service-type + (name 'zoxide) + (extensions + `(,@(if %home-zoxide-fish + (list (service-extension home-fish-service-type + %home-zoxide-fish)) + + '()))) + (description "")))