diff options
-rw-r--r-- | etc/guix/home.scm | 66 |
1 files changed, 62 insertions, 4 deletions
diff --git a/etc/guix/home.scm b/etc/guix/home.scm index 2122cb2..4235add 100644 --- a/etc/guix/home.scm +++ b/etc/guix/home.scm @@ -16,16 +16,66 @@ (name "msmtp-non-hardcoded") (arguments (substitute-keyword-arguments (package-arguments msmtp) - ((#:phases phases) + ((#:phases phases '%standard-phases) `(modify-phases ,phases (add-after 'install-additional-files 'patch-hardcoded-paths (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out"))) (substitute* (string-append out "/bin/msmtpq") - (("^LOG=.*$") "LOG=${XDG_LOG_HOME:-$HOME/.local/var/log}/msmtpq.log\n") - (("^Q=.*$") "Q=${XDG_DATA_HOME:-$HOME/.local/share}/msmtp/queue\n") + (("^LOG=.*$") "LOG=$XDG_LOG_HOME/msmtpq.log\n") + (("^Q=.*$") "Q=$XDG_DATA_HOME/msmtp/queue\n") (("mkdir -m 0700 \"\\$Q\"") "mkdir -p -m 0700 \"$Q\""))))))))))) +(define (with-options pkg bin opts) + (package + (inherit pkg) + (arguments + (substitute-keyword-arguments (package-arguments pkg) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + (add-after 'install 'wrap-with-flags + (lambda* (#:key outputs #:allow-other-keys) + (define (wrap-options prog options) + (let ((wrapped-file (string-append (dirname prog) "/." (basename prog) "-orig"))) + (rename-file prog wrapped-file) + (call-with-output-file prog + (lambda (port) + (format port + "#!/bin/sh~%~%exec \"~a\" ~a \"$@\"~%" + (canonicalize-path wrapped-file) + options))) + (chmod prog #o755))) + (wrap-options (string-append (assoc-ref outputs "out") + "/bin/" + ,bin) + ,opts))))))))) + +(define isync-with-options + (with-options isync "mbsync" "--config=\"$XDG_CONFIG_HOME\"/mbsync/config")) + +(define wget-with-options + (with-options wget "wget" "--hsts-file=\"$XDG_STATE_HOME\"/wget-hsts")) + +(define sbcl-with-options + (with-options sbcl "sbcl" "--userinit \"$XDG_CONFIG_HOME\"/sbcl/sbclrc.lisp")) + +(define tmux-with-options + (with-options tmux "tmux" "-f \"$XDG_CONFIG_HOME\"/tmux/tmux.conf")) + +(define myrepos-with-options + (with-options myrepos "mr" "-c \"$XDG_CONFIG_HOME\"/myrepos/config")) + +(define texinfo-with-options + (with-options texinfo "info" "--init-file \"$XDG_CONFIG_HOME\"/info/infokey")) + +(define mpv-with-options + (with-options mpv "mpv" (string-append "--script=" + (getenv "HOME") ;; (getenv "GUIX_PROFILE") ;; FIXME + "/.guix-home/profile/lib/mpris.so"))) + +(define openssh-with-options + (with-options openssh "ssh" "-F \"$XDG_CONFIG_HOME\"/ssh/config")) + (define (xdg-config-home s) (string-append (getenv "XDG_CONFIG_HOME") "/" s)) @@ -146,7 +196,15 @@ zathura-pdf-poppler zathura-ps firefox)) - (list msmtp-non-hardcoded))) + (list msmtp-non-hardcoded + isync-with-options + wget-with-options + sbcl-with-options + tmux-with-options + myrepos-with-options + texinfo-with-options + mpv-with-options + openssh-with-options))) (services (list (simple-service 'my-shell-profile home-shell-profile-service-type |