aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-05-12 20:49:49 -0300
committerEuAndreh <eu@euandre.org>2022-05-12 20:49:49 -0300
commit95164a1c432cb77f638dba89576839ca11cfd31b (patch)
tree4e45fba860df9ee48285c4111aa52c4f8ac58d4b
parentetc/guix/home.scm: Setup home-shell-profile-service-type (diff)
downloaddotfiles-95164a1c432cb77f638dba89576839ca11cfd31b.tar.gz
dotfiles-95164a1c432cb77f638dba89576839ca11cfd31b.tar.xz
etc/guix/home.scm: Use modified *-with-options packages
-rw-r--r--etc/guix/home.scm66
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