guix-channel

A channel for the Guix package manager

git clone https://git.8pit.net/guix-channel.git

  1(define-module (nmeum packages misc)
  2  #:use-module (nmeum packages)
  3  #:use-module (guix)
  4  #:use-module (guix build-system cargo)
  5  #:use-module (guix build-system copy)
  6  #:use-module (guix build-system gnu)
  7  #:use-module (guix build-system go)
  8  #:use-module (guix git-download)
  9  #:use-module ((guix licenses) #:prefix license:)
 10  #:use-module (gnu packages base)
 11  #:use-module (gnu packages bash)
 12  #:use-module (gnu packages gnupg)
 13  #:use-module (gnu packages golang-xyz)
 14  #:use-module (gnu packages mail)
 15  #:use-module (gnu packages perl)
 16  #:use-module (gnu packages pkg-config)
 17  #:use-module (gnu packages shells)
 18  #:use-module (gnu packages sqlite)
 19  #:use-module (gnu packages tree-sitter)
 20  #:use-module (gnu packages version-control)
 21  #:use-module (gnu packages vim)
 22  #:use-module (srfi srfi-26))
 23
 24;; TODO: This cannot be properly used with Guix right now because
 25;; gnu/system/keyboard.scm unconditionally generates the keyboard
 26;; console-keymap from xkeyboard-config.
 27(define-public neo-layout
 28  (let ((commit "97cfdd486dcd278833b80dc396e00a1c3503e6d6")
 29        (revision "1"))
 30    (package
 31      (name "neo-layout")
 32      (version (git-version "20220410" revision commit))
 33      (source
 34        (origin
 35          (method git-fetch)
 36          (uri (git-reference
 37                 (url "https://git.neo-layout.org/neo/neo-layout.git")
 38                 (commit commit)))
 39          (file-name (git-file-name name version))
 40          (sha256
 41            (base32 "0xg3n808rphn9jlpvgc4y1pz8kdjv916xshg64lkp4hakip1p45j"))))
 42      (build-system copy-build-system)
 43      (arguments
 44        `(#:install-plan
 45          '(("linux/console/neo.map" "usr/share/keymaps/legacy/i386/qwertz/neo.map"))))
 46      (home-page "https://neo-layout.org")
 47      (synopsis "Keyboard layout optimized for the German language")
 48      (description "This provides the original handwritten version of the
 49neo-layout for kbd's @code{loadkeys(1)}.  Contrary to the version generated
 50from xkeyboard-config, layer 4 actually works.")
 51      (license license:gpl3))))
 52
 53(define-public mblaze-ui
 54  (package
 55    (name "mblaze-ui")
 56    (version "0.0.0-20250423085554-54f778f3d6a8")
 57    (source
 58     (origin
 59       (method git-fetch)
 60       (uri (git-reference
 61             (url "https://git.8pit.net/mblaze-ui.git")
 62             (commit (go-version->git-ref version))))
 63       (file-name (git-file-name name version))
 64       (sha256
 65        (base32 "104fjj7da2cp2f6g8h4y6ycs68ml8smiq11clx3dc07y191mnzf1"))))
 66    (build-system go-build-system)
 67    (arguments
 68     (list
 69      #:install-source? #f
 70      #:import-path "github.com/nmeum/mblaze-ui"))
 71    (native-inputs (list mblaze
 72                         go-github-com-mattn-go-runewidth
 73                         go-github-com-gdamore-tcell-v2))
 74    (home-page "https://github.com/nmeum/mblaze-ui")
 75    (synopsis "mblaze-ui")
 76    (description "")
 77    (license license:gpl3+)))
 78
 79(define-public git-shuffle
 80  (let ((commit "06ac27513a275c979aa57cd8c932b90c8cb689eb")
 81        (revision "1"))
 82    (package
 83      (name "git-shuffle")
 84      (version (git-version "20251025" revision commit))
 85      (source
 86       (origin
 87         (method git-fetch)
 88         (uri (git-reference
 89               (url "https://git.8pit.net/git-shuffle.git")
 90               (commit commit)))
 91         (file-name (git-file-name name version))
 92         (sha256
 93          (base32 "1say9ap60l04i3lj4gbf0dn6zbf457cf5fdvlwdh4y7rfi8hq3m0"))))
 94      (build-system gnu-build-system)
 95      (arguments
 96       (list
 97        #:tests? #f
 98        #:make-flags
 99        #~(list "CFLAGS=-O2"
100                "PREFIX=/"
101                (string-append "DESTDIR=" #$output)
102                (string-append "CC=" #$(cc-for-target)))
103        #:phases
104        #~(modify-phases %standard-phases
105            (delete 'configure))))
106      (inputs (list pkg-config))
107      (native-inputs (list libgit2))
108      (home-page "https://git.8pit.net/git-shuffle")
109      (synopsis "Randomize timestamps associated with Git commits to enhance privacy")
110      (description "")
111      (license license:gpl3))))
112
113;; TODO: Use package-with-extra-patches somehow, however, we need to change
114;; the package name somehow as loksh would otherwise be ambiguous and not
115;; sure how do that on a package returned by package-with-extra-patches.
116(define-public loksh-8pit
117  (package
118    (inherit loksh)
119    (name "loksh-8pit")
120    (source
121     (origin
122       (inherit (package-source loksh))
123       (patches (nmeum-patches
124                  "loksh-bracketed-paste-mode.patch"
125                  "loksh-kshbasename.patch"))))))
126
127;; XXX: https://codeberg.org/guix/guix/pulls/6295
128(define-public neovim-8pit
129  (package
130    (inherit neovim)
131    (name "neovim-8pit")
132    (source
133     (origin
134       (inherit (package-source neovim))
135       (patches (nmeum-patches "neovim-tree-sitter-grammar-path.patch"))))
136    (propagated-inputs
137     ;; bundled tree-sitters, neovim assumes that these are available.
138     ;; See https://neovim.io/doc/user/treesitter.html#treesitter-parsers
139     (list tree-sitter-c tree-sitter-lua tree-sitter-markdown
140           ;; TODO: tree-sitter-vimscript
141           tree-sitter-vimdoc))
142    (native-search-paths
143     (list (search-path-specification
144            (variable "TREE_SITTER_GRAMMAR_PATH")
145            (files '("lib/tree-sitter")))))))
146
147(define-public tpm
148  (package
149    (name "tpm")
150    (version "1.3.3")
151    (source
152     (origin
153       (method git-fetch)
154       (uri (git-reference
155             (url "https://git.8pit.net/tpm.git")
156             (commit version)))
157       (file-name (git-file-name name version))
158       (sha256
159        (base32 "109q5ag4cbrxbr2slnb3ii9zkjnim5yxfb3j34yf3r32yd6kmjlg"))))
160    (build-system gnu-build-system)
161    (arguments
162     (list
163      #:tests? #f
164      #:make-flags
165      #~(list "PREFIX=/"
166              (string-append "DESTDIR=" #$output))
167      #:phases
168      #~(modify-phases %standard-phases
169          (add-after 'unpack 'fix-paths
170            (lambda* (#:key inputs outputs #:allow-other-keys)
171              (substitute* "tpm"
172                (("gpg2")
173                 (search-input-file inputs "/bin/gpg")))))
174          (delete 'configure))))
175    (inputs (list gnupg))
176    (native-inputs (list perl))
177    (home-page "https://git.8pit.net/tpm")
178    (synopsis "Tiny password manager")
179    (description
180     "Tiny shell script which is heavily inspired and largely
181compatible with @code{pass}.  Just like pass it uses @code{gnupg} to securely
182store your passwords, the major difference between pass and tpm is that the
183latter is a lot more minimal.")
184    (license license:gpl3)))
185
186(define-public pimsync
187  (package
188    (name "pimsync")
189    (version "0.5.6")
190    (source
191      (origin
192        (method git-fetch)
193        (uri (git-reference
194               (url "https://git.sr.ht/~whynothugo/pimsync")
195               (commit (string-append "v" version))))
196        (file-name (git-file-name name version))
197        (sha256
198          (base32 "01qxg0mk7if96rmb0q88wgjpnv1fb8iw2dbzwlm0ars1mi3xpmr3"))))
199    (build-system cargo-build-system)
200    (arguments
201      (list #:install-source? #f
202            #:phases
203            #~(modify-phases %standard-phases
204                (add-after 'unpack 'setup-environment
205                  (lambda _
206                    (setenv "PIMSYNC_VERSION" #$version)))
207                (add-after 'install 'install-man-pages
208                  (lambda _
209                    (let ((man (string-append #$output "/share/man/man")))
210                      (install-file "pimsync.1" (string-append man "1"))
211                      (install-file "pimsync.conf.5" (string-append man "5"))
212                      (install-file "pimsync-migration.7" (string-append man "7"))))))))
213    (inputs (cons* sqlite (cargo-inputs 'pimsync #:module '(nmeum packages rust-crates))))
214    (synopsis "Synchronize calendars and contacts using CalDAV, CardDAV and others")
215    (description "pimsync synchronizes your calendars and contacts between two
216storage locations.  The most popular purpose is to synchronize a CalDAV or
217CardDAV server with a local folder or file.")
218    (home-page "https://pimsync.whynothugo.nl/")
219    (license license:eupl1.2)))
220
221(define-public go-webdav
222  (package/inherit go-github-com-emersion-go-webdav
223    (name "go-webdav")
224    (arguments
225      (substitute-keyword-arguments
226        (package-arguments go-github-com-emersion-go-webdav)
227        ((#:tests? _ #t) #f)
228        ((#:install-source? _ #t) #f)
229        ((#:import-path _ "github.com/emersion/go-webdav") "github.com/emersion/go-webdav/cmd/webdav-server")
230        ((#:unpack-path _ "") "github.com/emersion/go-webdav")))
231    (native-inputs (package-propagated-inputs go-github-com-emersion-go-webdav))
232    (propagated-inputs '())
233    (inputs '())))
234
235(define-public archive-mail
236  (package
237    (name "archive-mail")
238    (version "v0.0.0-20260103100740-0b0c03251191")
239    (source
240     (origin
241       (method git-fetch)
242       (uri (git-reference
243             (url "https://git.8pit.net/archive-mail.git")
244             (commit (go-version->git-ref version))))
245       (file-name (git-file-name name version))
246       (sha256
247        (base32 "1fdwf2xyy8gkvagq6ivsd0kvfxx9xl3fvd81v54agwmlszxa8jc6"))))
248    (build-system go-build-system)
249    (arguments
250     (list
251      #:install-source? #f
252      #:import-path "github.com/nmeum/archive-mail"
253      #:phases
254      #~(modify-phases %standard-phases
255          (replace 'check
256            (lambda* (#:key tests? import-path #:allow-other-keys)
257              (when tests?
258                (with-directory-excursion (string-append "src/" import-path "/tests")
259                   (setenv "ARCHIVE_MAIL" (in-vicinity (getenv "GOBIN") "archive-mail"))
260                   (invoke "./run_tests.sh"))))))))
261    (inputs (list bash-minimal diffutils))
262    (home-page "https://git.8pit.net/archive-logs")
263    (synopsis "archive-mail")
264    (description "")
265    (license license:gpl3+)))
266
267(define-public archive-logs
268  (let ((commit "faaf2e85ee419c7b0a3c4dd0f5932834d2fb9d60")
269        (revision "0"))
270    (package
271      (name "archive-logs")
272      (version (git-version "20211124" revision commit))
273      (source
274       (origin
275         (method git-fetch)
276         (uri (git-reference
277               (url "https://git.8pit.net/archive-logs.git")
278               (commit commit)))
279         (file-name (git-file-name name version))
280         (sha256
281          (base32 "0d9fxbrajzjnb6cvaw8x363583gvdplw0yfbk7qgzzrsyfdqa52d"))))
282      (build-system gnu-build-system)
283      (arguments
284       (list
285        #:test-target "check"
286        #:make-flags
287        #~(list "CFLAGS=-O2"
288                "HAVE_SENDFILE=1"
289                "PREFIX=/"
290                (string-append "DESTDIR=" #$output)
291                (string-append "CC=" #$(cc-for-target)))
292        #:phases
293        #~(modify-phases %standard-phases
294            (delete 'configure))))
295      (inputs (list bash-minimal))
296      (home-page "https://git.8pit.net/archive-logs")
297      (synopsis "Iteratively archive newline separated log files")
298      (description "")
299      (license license:gpl3))))