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 (guix)
  3  #:use-module (guix build-system cargo)
  4  #:use-module (guix build-system copy)
  5  #:use-module (guix build-system gnu)
  6  #:use-module (guix build-system go)
  7  #:use-module (guix git-download)
  8  #:use-module ((guix licenses) #:prefix license:)
  9  #:use-module (gnu packages gnupg)
 10  #:use-module (gnu packages golang-xyz)
 11  #:use-module (gnu packages mail)
 12  #:use-module (gnu packages man)
 13  #:use-module (gnu packages perl)
 14  #:use-module (gnu packages pkg-config)
 15  #:use-module (gnu packages shells)
 16  #:use-module (gnu packages sqlite)
 17  #:use-module (gnu packages version-control)
 18  #:use-module (gnu packages web)
 19  #:use-module (srfi srfi-26))
 20
 21;; TODO: This cannot be properly used with Guix right now because
 22;; gnu/system/keyboard.scm unconditionally generates the keyboard
 23;; console-keymap from xkeyboard-config.
 24(define-public neo-layout
 25  (let ((commit "97cfdd486dcd278833b80dc396e00a1c3503e6d6")
 26        (revision "1"))
 27    (package
 28      (name "neo-layout")
 29      (version (git-version "20220410" revision commit))
 30      (source
 31        (origin
 32          (method git-fetch)
 33          (uri (git-reference
 34                 (url "https://git.neo-layout.org/neo/neo-layout.git")
 35                 (commit commit)))
 36          (file-name (git-file-name name version))
 37          (sha256
 38            (base32 "0xg3n808rphn9jlpvgc4y1pz8kdjv916xshg64lkp4hakip1p45j"))))
 39      (build-system copy-build-system)
 40      (arguments
 41        `(#:install-plan
 42          '(("linux/console/neo.map" "usr/share/keymaps/legacy/i386/qwertz/neo.map"))))
 43      (home-page "https://neo-layout.org")
 44      (synopsis "Keyboard layout optimized for the German language")
 45      (description "This provides the original handwritten version of the
 46neo-layout for kbd's @code{loadkeys(1)}.  Contrary to the version generated
 47from xkeyboard-config, layer 4 actually works.")
 48      (license license:gpl3))))
 49
 50(define-public mblaze-ui
 51  (package
 52    (name "mblaze-ui")
 53    (version "0.0.0-20250423085554-54f778f3d6a8")
 54    (source
 55     (origin
 56       (method git-fetch)
 57       (uri (git-reference
 58             (url "https://git.8pit.net/mblaze-ui.git")
 59             (commit (go-version->git-ref version))))
 60       (file-name (git-file-name name version))
 61       (sha256
 62        (base32 "104fjj7da2cp2f6g8h4y6ycs68ml8smiq11clx3dc07y191mnzf1"))))
 63    (build-system go-build-system)
 64    (arguments
 65     (list
 66      #:install-source? #f
 67      #:import-path "github.com/nmeum/mblaze-ui"))
 68    (propagated-inputs (list mblaze
 69                             go-github-com-mattn-go-runewidth
 70                             go-github-com-gdamore-tcell-v2))
 71    (home-page "https://github.com/nmeum/mblaze-ui")
 72    (synopsis "mblaze-ui")
 73    (description "")
 74    (license license:gpl3+)))
 75
 76(define-public git-shuffle
 77  (let ((commit "06ac27513a275c979aa57cd8c932b90c8cb689eb")
 78        (revision "1"))
 79    (package
 80      (name "git-shuffle")
 81      (version (git-version "20251025" revision commit))
 82      (source
 83       (origin
 84         (method git-fetch)
 85         (uri (git-reference
 86               (url "https://git.8pit.net/git-shuffle.git")
 87               (commit commit)))
 88         (file-name (git-file-name name version))
 89         (sha256
 90          (base32 "1say9ap60l04i3lj4gbf0dn6zbf457cf5fdvlwdh4y7rfi8hq3m0"))))
 91      (build-system gnu-build-system)
 92      (arguments
 93       (list
 94        #:tests? #f
 95        #:make-flags
 96        #~(list "CFLAGS=-O2"
 97                "PREFIX=/"
 98                (string-append "DESTDIR=" #$output)
 99                (string-append "CC=" #$(cc-for-target)))
100        #:phases
101        #~(modify-phases %standard-phases
102            (delete 'configure))))
103      (inputs (list pkg-config))
104      (native-inputs (list libgit2))
105      (home-page "https://git.8pit.net/git-shuffle")
106      (synopsis "Randomize timestamps associated with Git commits to enhance privacy")
107      (description "")
108      (license license:gpl3))))
109
110;; TODO: Use package-with-extra-patches somehow, however, we need to change
111;; the package name somehow as loksh would otherwise be ambiguous and not
112;; sure how do that on a package returned by package-with-extra-patches.
113(define-public loksh-8pit
114  (package
115    (inherit loksh)
116    (name "loksh-8pit")
117    (source
118     (origin
119       (inherit (package-source loksh))
120       (patches (map (lambda (patch)
121                       (search-path (map (cut string-append <>
122                                              "/nmeum/packages/patches")
123                                         %load-path) patch))
124                     '("loksh-bracketed-paste-mode.patch"
125                       "loksh-kshbasename.patch")))))))
126
127(define-public tpm
128  (package
129    (name "tpm")
130    (version "1.3.3")
131    (source
132     (origin
133       (method git-fetch)
134       (uri (git-reference
135             (url "https://git.8pit.net/tpm.git")
136             (commit version)))
137       (file-name (git-file-name name version))
138       (sha256
139        (base32 "109q5ag4cbrxbr2slnb3ii9zkjnim5yxfb3j34yf3r32yd6kmjlg"))))
140    (build-system gnu-build-system)
141    (arguments
142     (list
143      #:tests? #f
144      #:make-flags
145      #~(list "PREFIX=/"
146              (string-append "DESTDIR=" #$output))
147      #:phases
148      #~(modify-phases %standard-phases
149          (add-after 'unpack 'fix-paths
150            (lambda* (#:key inputs outputs #:allow-other-keys)
151              (substitute* "tpm"
152                (("gpg2")
153                 (search-input-file inputs "/bin/gpg")))))
154          (delete 'configure))))
155    (inputs (list gnupg))
156    (native-inputs (list perl))
157    (home-page "https://git.8pit.net/tpm")
158    (synopsis "Tiny password manager")
159    (description
160     "Tiny shell script which is heavily inspired and largely
161compatible with @code{pass}.  Just like pass it uses @code{gnupg} to securely
162store your passwords, the major difference between pass and tpm is that the
163latter is a lot more minimal.")
164    (license license:gpl3)))
165
166(define-public pimsync
167  (package
168    (name "pimsync")
169    (version "0.5.2")
170    (source
171      (origin
172        (method git-fetch)
173        (uri (git-reference
174               (url "https://git.sr.ht/~whynothugo/pimsync")
175               (commit (string-append "v" version))))
176        (file-name (git-file-name name version))
177        (sha256
178          (base32 "0r8ph1gra5d9wb06c8khcz0rpjak2dcpvkvdm7aj55gdvcnx4v9d"))))
179    (build-system cargo-build-system)
180    (arguments
181      (list #:install-source? #f
182            #:phases
183            #~(modify-phases %standard-phases
184                ;; XXX: Forcefully disable experimental jmap support as it
185                ;; introduces a dependency on jmap-tools which does not compile
186                ;; with rustc-1.85.1 due to utilization of unstable rustc
187                ;; features.  Can be removed once we upgrade to rustc-1.86.X.
188                (add-after 'unpack 'disable-jmap
189                  (lambda _
190                    (substitute* "Cargo.toml"
191                      ((".*jmap.*") ""))))
192                (add-after 'unpack 'setup-environment
193                  (lambda _
194                    (setenv "PIMSYNC_VERSION" #$version)))
195                (add-after 'install 'install-man-pages
196                  (lambda _
197                    (let ((man (string-append #$output "/share/man/man")))
198                      (install-file "pimsync.1" (string-append man "1"))
199                      (install-file "pimsync.conf.5" (string-append man "5"))
200                      (install-file "pimsync-migration.7" (string-append man "7"))))))))
201    (inputs (cons* sqlite (cargo-inputs 'pimsync #:module '(nmeum packages rust-crates))))
202    (synopsis "Synchronize calendars and contacts using CalDAV, CardDAV and others")
203    (description "pimsync synchronizes your calendars and contacts between two
204storage locations.  The most popular purpose is to synchronize a CalDAV or
205CardDAV server with a local folder or file.")
206    (home-page "https://pimsync.whynothugo.nl/")
207    (license license:eupl1.2)))
208
209;; See https://codeberg.org/guix/guix/pulls/4575
210(define-public nginx-webdav
211  (package
212    (inherit nginx)
213    (name "nginx-webdav")
214    (arguments
215      (substitute-keyword-arguments (package-arguments nginx)
216        ((#:configure-flags flags)
217         #~(cons "--with-http_dav_module" #$flags))))))
218
219(define-public sogogi
220  (let ((commit "afabb59eb615853a271c2af8cca03b60a6ca850e")
221        (revision "0"))
222    (package
223      (name "sogogi")
224      (version (git-version "20250214" revision commit))
225      (source
226       (origin
227         (method git-fetch)
228         (uri (git-reference
229               (url "https://codeberg.org/emersion/sogogi.git")
230               (commit commit)))
231         (file-name (git-file-name name version))
232         (sha256
233          (base32 "09pi493xz1nkjd1n05nh09whv1shy0mxxy9p56fjh6r87l5b8dnj"))
234         (modules '((guix build utils)))
235         ;; Fix import path for itself in the example code (build by 'check).
236         (snippet '(substitute* "config.go"
237                     (("git.sr.ht/~emersion/go-scfg")
238                       "codeberg.org/emersion/go-scfg")))))
239      (build-system go-build-system)
240      (arguments
241        (list
242          #:install-source? #f
243          #:import-path "codeberg.org/emersion/sogogi"
244          #:phases
245          #~(modify-phases %standard-phases
246              (add-after 'install 'install-man-page
247                (lambda* (#:key import-path #:allow-other-keys)
248                  (let ((man (string-append #$output "/share/man/man")))
249                    (with-input-from-file (string-append "src/" import-path
250                                                         "/doc/sogogi.1.scd")
251                      (lambda _
252                        (mkdir-p (string-append man "1"))
253                        (with-output-to-file (string-append man "1/sogogi.1")
254                          (lambda _
255                            (invoke "scdoc")))))))))))
256      (native-inputs (list go-github-com-emersion-go-webdav
257                           go-codeberg-org-emersion-go-scfg
258                           scdoc))
259      (home-page "https://codeberg.org/emersion/sogogi")
260      (synopsis "Simple WebDav server")
261      (description
262        "This package provides a simple WebDAV file server.  The server exposes
263a configured local filesystem to remote users via HTTP.")
264      (license license:agpl3))))