aboutsummaryrefslogtreecommitdiff
path: root/etc/guix/home.scm
blob: 607a059a94365a9c309c2ee735c7539012a81cd1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
(use-modules
  (curth0)
  (gnu home services)
  (gnu home services shells)
  (gnu packages)
  (gnu packages mail)
  (gnu packages gnupg)
  (gnu services)
  (guix gexp)
  (guix packages)
  (guix utils))

(define msmtp-non-hardcoded
  (package
    (inherit msmtp)
    (name "msmtp-non-hardcoded")
    (arguments
      (substitute-keyword-arguments (package-arguments msmtp)
        ((#:phases 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")
                    (("mkdir -m 0700 \"\\$Q\"")   "mkdir -p -m 0700 \"$Q\"")))))))))))

(define (xdg-config-home s)
  (string-append (getenv "XDG_CONFIG_HOME") "/" s))

(define gitconfig (mixed-text-file "gitconfig" #"-
	[user]
	  email = eu@euandre.org
	  name = EuAndreh
	  signingkey = 81F90EC3CD356060
	[transfer]
	  fsckobjects = true
	[push]
	  default = current
	[commit]
	  gpgsign = true
	  verbose = true
	[init]
	  defaultBranch = main
	[sendemail]
	  assume8bitEncoding = UTF-8
	  smtpserveroption = -a
	  smtpserveroption = euandreh
	  annotate = yes
	  confirm = never
	  smtpserver = "# msmtp-non-hardcoded "/bin/msmtpq\n"))

(define gpg-agent.conf (mixed-text-file "gpg-agent.conf" #"-
	default-cache-ttl 172800
	default-cache-ttl-ssh 172800
	max-cache-ttl 604800
	max-cache-ttl-ssh 604800
	enable-ssh-support
	pinentry-program "# pinentry-gtk2 "/bin/pinentry-gtk-2\n"))

(define config-files
  `(("gnupg/gpg-agent.conf" ,gpg-agent.conf)
    ("git/config" ,gitconfig)))

(define (dot-config)
  (define (prefix-with-config s)
    (string-append (substring (getenv "XDG_CONFIG_HOME")
                              (+ 1 (string-length (getenv "HOME"))))
                   "/"
                   s))
  (map (lambda (t)
         (list (prefix-with-config (first t))
               (second t)))
       config-files))

(home-environment
  (packages
    (append
     (map (compose list specification->package+output symbol->string)
          '(man-pages
            posix-man-pages

            tree
            openssh
            mailutils
            entr
            git
            git:send-email
            tmux
            rsync
            gnupg
            pulseaudio
            password-store
            playerctl
            pinentry-gtk2
            bmake
            fzf
            ranger
            blueman
            ledger
            curl
            xclip
            cloc
            strace
            file
            urlscan
            rlwrap
            direnv
            borg
            khal
            khard
            libfaketime
            qrencode
            feh
            sox
            xset
            graphviz
            moreutils
            shellcheck
            gettext
            groff

            clojure
            openjdk
            sbcl
            perl
            perl-mojolicious

            st
            i3status
            dmenu

            weechat
            alot
            notmuch
            isync
            w3m
            afew

            zathura
            zathura-djvu
            zathura-pdf-poppler
            zathura-ps
            firefox))
     (list msmtp-non-hardcoded)))
  (services
    (list (service home-bash-service-type
            (home-bash-configuration
              (bashrc
                (list (plain-file "bashrc.sh" ". $XDG_CONFIG_HOME/bash/rc")))))
          (simple-service 'config-files home-files-service-type (dot-config)))))