summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tw/home/common.scm47
-rw-r--r--tw/home/lap.scm3
-rw-r--r--tw/home/lud.scm3
3 files changed, 30 insertions, 23 deletions
diff --git a/tw/home/common.scm b/tw/home/common.scm
index 622b54cc..4aee687c 100644
--- a/tw/home/common.scm
+++ b/tw/home/common.scm
@@ -32,33 +32,18 @@
zsh zsh-autosuggestions zsh-syntax-highlighting zsh-autopair
zsh-completions))
-(define-public common-services
+(export gnupg-services) ; there doesn't seem to be a `define*-public' macro
+(define* (gnupg-services #:key gui-pinentry?)
(list
- (service home-zsh-service-type
- (home-zsh-configuration
- (zshrc (list (local-file "files/zshrc")
- (local-file "files/prompt.zsh")))))
-
- (simple-service 'common-config home-xdg-configuration-files-service-type
- `(("git/config" ,(local-file "files/gitconfig"))
- ("htop/htoprc" ,(local-file "files/htoprc"))
- ("lesskey" ,(local-file "files/lesskey"))
- ("ranger/rc.conf" ,(local-file "files/ranger.conf"))
- ("tmux/tmux.conf" ,(local-file "files/tmux.conf"))
- ("user-dirs.locale" ,(plain-file "user-dirs.locale" "C")) ; Not sure if this is needed. Arch has it.
- ("user-dirs.dirs" ,(local-file "files/user-dirs.dirs"))))
-
- (simple-service 'common-scripts home-files-service-type
- ;; With #:recursive? #t, Guix keeps the files' permission bits, i.e. makes them executable.
- `((".local/bin/ppscm" ,(local-file "files/ppscm" #:recursive? #t)))) ; pretty-print scheme files
-
(simple-service 'gnupg-config home-files-service-type
`(;; GnuPG config files must be in ~/.local/share/gnupg, not ~/.config,
;; so we can't use `home-xdg-configuration-files-service-type'.
(".local/share/gnupg/gpg.conf" ,(local-file "files/gpg.conf"))
(".local/share/gnupg/gpg-agent.conf"
,(mixed-text-file "gpg-agent.conf" "\
-pinentry-program " (file-append pinentry-rofi "/bin/pinentry-rofi") "
+pinentry-program " (if gui-pinentry?
+ (file-append pinentry-rofi "/bin/pinentry-rofi")
+ (file-append pinentry-tty "/bin/pinentry-tty")) "
# Needed if spawning lots of parallel gpg --decrypt processes. https://dev.gnupg.org/T3530
auto-expand-secmem
"))))
@@ -72,7 +57,27 @@ auto-expand-secmem
(invoke #$(file-append gnupg "/bin/gpg-agent")
"--daemon" "--no-detach")))
(stop #~(lambda _
- (invoke "gpg-connect-agent" "killagent" "/bye"))))))
+ (invoke "gpg-connect-agent" "killagent" "/bye"))))))))
+
+(define-public common-services
+ (list
+ (service home-zsh-service-type
+ (home-zsh-configuration
+ (zshrc (list (local-file "files/zshrc")
+ (local-file "files/prompt.zsh")))))
+
+ (simple-service 'common-config home-xdg-configuration-files-service-type
+ `(("git/config" ,(local-file "files/gitconfig"))
+ ("htop/htoprc" ,(local-file "files/htoprc"))
+ ("lesskey" ,(local-file "files/lesskey"))
+ ("ranger/rc.conf" ,(local-file "files/ranger.conf"))
+ ("tmux/tmux.conf" ,(local-file "files/tmux.conf"))
+ ("user-dirs.locale" ,(plain-file "user-dirs.locale" "C")) ; Not sure if this is needed. Arch has it.
+ ("user-dirs.dirs" ,(local-file "files/user-dirs.dirs"))))
+
+ (simple-service 'common-scripts home-files-service-type
+ ;; With #:recursive? #t, Guix keeps the files' permission bits, i.e. makes them executable.
+ `((".local/bin/ppscm" ,(local-file "files/ppscm" #:recursive? #t)))) ; pretty-print scheme files
(simple-service 'common-environment home-environment-variables-service-type
`(;; Path to my own package definitions. If invoking `guix home'
diff --git a/tw/home/lap.scm b/tw/home/lap.scm
index 7e7fab32..becb74e5 100644
--- a/tw/home/lap.scm
+++ b/tw/home/lap.scm
@@ -324,4 +324,5 @@
(".local/bin/passmenu" ,(local-file "files/passmenu" #:recursive? #t))
(".local/bin/volume" ,(local-file "files/volume" #:recursive? #t))))
- (append common-services emacs-services pim-services))))
+ (append (gnupg-services #:gui-pinentry? #t)
+ common-services emacs-services pim-services))))
diff --git a/tw/home/lud.scm b/tw/home/lud.scm
index 10f4b107..44cd0c2b 100644
--- a/tw/home/lud.scm
+++ b/tw/home/lud.scm
@@ -7,4 +7,5 @@
;; These packages will show up in the home profile, under ~/.guix-home/profile.
(packages (append common-packages emacs-packages))
;; To search for available home services, run 'guix home search KEYWORD'.
- (services (append common-services emacs-services)))
+ (services (append (gnupg-services #:gui-pinentry? #f)
+ common-services emacs-services)))