summaryrefslogtreecommitdiff
path: root/systems/izumi/home-configuration.scm
blob: dcb6aceafbc0cc444d046d3da2a10077fa4c6033 (about) (plain)
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
(define-module (systems izumi home-configuration))

(use-modules
 ( channels )
 (gnu home)
 (gnu home services shells))

(use-modules
 (gnu)
 (gnu home services))

(use-package-modules emacs-xyz)

(use-service-modules)
(use-modules
 (gnu)
 (gnu home services)
 (guix build-system emacs)
 (guix git-download)
 ((guix licenses)
  #:prefix license:)
 (guix packages))

(use-package-modules base emacs-xyz gawk)
(use-modules
 (gnu services)
 (gnu home services)
 (gnu packages password-utils)
 (guix gexp))
(use-modules
 (gnu home services shells)
 (gnu services))

(home-environment (packages (map specification->package+output
                                 (list "dconf-editor"
                                       "emacs"
                                       "emacs-org-modern"
                                       "emacs-paredit"
                                       "font-google-noto"
                                       "font-google-noto-emoji"
                                       "font-google-noto-sans-cjk"
                                       "font-google-noto-serif-cjk"
                                       "git"
                                       "gnupg"
                                       "gnome-tweaks"
                                       "noweb"
                                       "pinentry"
                                       "pwgen"
                                       "unzip"
                                       "zip")))
                  (services (append (list izumi-channels-service-type)
                                    (list
                                     (simple-service
                                      'emacs-home-profile
                                      home-profile-service-type
                                      (append
                                       (list emacs-guix emacs-nix-mode)
                                       (list
                                        (let
                                            ((commit* "wip-algo-tn"))
                                          (package
                                           (name "emacs-org-fc")
                                           (version (git-version "0.1.2" "0" commit*))
                                           (source
                                            (origin
                                             (method git-fetch)
                                             (uri
                                              (git-reference
                                               (url "https://git.marekpasnikowski.pl/org-fc.git")
                                               (commit commit*)))
                                             (file-name (git-file-name name version))
                                             (sha256 (base32 "1i8ii1garx2pdg08a12yzsd0fhwdzcpxp9m97zj8m5s275i8ccaj"))))
                                           (build-system emacs-build-system)
                                           (arguments
                                            (list
                                             #:include #~ (cons* "\\.awk$" "\\.org$" %default-include)
                                             #:exclude #~ (cons "^test/" %default-exclude)
                                             #:tests? #t
                                             #:test-command
                                             #~
                                             (list
                                              "emacs"
                                              "--batch"
                                              "-L" "."
                                              "-L" "tests/"
                                              "-l" "tests/org-fc-filter-test.el"
                                              "-l" "tests/org-fc-indexer-test.el"
                                              "-l" "tests/org-fc-review-data-test.el"
                                              "-f" "ert-run-tests-batch-and-exit")
                                             #:phases
                                             #~
                                             (modify-phases
                                              %standard-phases
                                              (add-after
                                               'unpack
                                               'qualify-paths
                                               (lambda*
                                                   (#:key inputs
                                                    #:allow-other-keys)
                                                 (substitute*
                                                  "org-fc-awk.el"
                                                  (("\"find ")
                                                   (string-append
                                                    "\""
                                                    (search-input-file inputs "/bin/find")
                                                    " "))
                                                  (("\"gawk ")
                                                   (string-append
                                                    "\""
                                                    (search-input-file inputs "/bin/gawk")
                                                    " "))
                                                  (("\"xargs ")
                                                   (string-append
                                                    "\""
                                                    (search-input-file inputs "/bin/xargs")
                                                    " "))))))))
                                           (inputs (list findutils gawk))
                                           (propagated-inputs (list emacs-hydra))
                                           (home-page "https://www.leonrische.me/fc/index.html")
                                           (synopsis "Spaced repetition system for Emacs Org mode")
                                           (description
                                            (string-append
                                             "Org-fc is a spaced-repetition system for Emacs' Org mode.\n"
                                             "It allows you to mark headlines in a file as flashcards, turning pieces of\n"
                                             "knowledge you want to learn into a question-answer test.  These cards are\n"
                                             "reviewed at regular interval.  After each review, the next review interval is\n"
                                             "calculated based on how well you remembered the contents of the card.\n"))
                                           (license license:gpl3+))))))
                                     (simple-service 'home-files
                                                     home-files-service-type
                                                     (list (list ".config/emacs/init.el"
                                                                 (local-file "home-files/emacs-configuration.el" ))
                                                           (list ".gnus"
                                                                 (local-file "home-files/gnus-configuration.el"))
                                                           (list ".gitconfig"
                                                                 (local-file "home-files/gitconfig"))
                                                           (list ".config/git/ignore"
                                                                 ;; https://github.com/github/gitignore/blob/main/Global/Emacs.gitignore
                                                                 (local-file "home-files/git-ignore.conf"))))
                                     (simple-service
                                      'environment-variables
                                      home-environment-variables-service-type
                                      `(("EDITOR" . "emacsclient -nw"))))
                                    (list
                                     (let*
                                         ((and "&& ")
                                          (collect-garbage "sudo guix gc -d 7d ")
                                          (configuration-prefix
                                           "/home/marek/Publiczny/src/deployment/systems/izumi/")
                                          (pull-guix "guix pull ")
                                          (reconfigure-home
                                           (string-append
                                            "guix home delete-generations 7d ; "
                                            "guix home reconfigure "
                                            configuration-prefix
                                            "home-configuration.scm "))
                                          (reconfigure-system
                                           (string-append
                                            "sudo guix system delete-generations 7d ; "
                                            "sudo guix system reconfigure "
                                            configuration-prefix
                                            "system-configuration.scm "))
                                          (update-system
                                           (string-append
                                            pull-guix
                                            and
                                            reconfigure-system
                                            and
                                            reconfigure-home
                                            and
                                            collect-garbage)))
                                       (simple-service
                                        'bash-extension
                                        home-bash-service-type
                                        (home-bash-extension
                                         (aliases
                                          `(("collect-garbage" . ,collect-garbage)
                                            ("edit" . "$EDITOR")
                                            ("pull-guix" . ,pull-guix)
                                            ("reconfigure-home" . ,reconfigure-home)
                                            ("reconfigure-system" . ,reconfigure-system)
                                            ("update-system" . ,update-system)))
                                         (bash-profile
                                          (list
                                           (mixed-text-file
                                            "newline-prompt"
                                            "PS1=${PS1%?}\n"
                                            "PS1=${PS1%?}\\n'$ '\n"
                                            "PS1=\"\\n$PS1\""))))))))))