guix-channel

A channel for the Guix package manager

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

  1(define-module (nmeum packages zk)
  2  #:use-module (guix)
  3  #:use-module (guix build-system go)
  4  #:use-module (guix git-download)
  5  #:use-module ((guix licenses) #:prefix license:)
  6  #:use-module (gnu packages golang-build)
  7  #:use-module (gnu packages golang-check)
  8  #:use-module (gnu packages golang-web)
  9  #:use-module (gnu packages golang-xyz)
 10  #:use-module (gnu packages terminals))
 11
 12(define-public go-github-com-aymerick-raymond
 13  (package
 14    (name "go-github-com-aymerick-raymond")
 15    (version "2.0.2")
 16    (source
 17     (origin
 18       (method git-fetch)
 19       (uri (git-reference
 20             (url "https://github.com/aymerick/raymond")
 21             (commit (string-append "v" version))))
 22       (file-name (git-file-name name version))
 23       (sha256
 24        (base32 "0s5nxzx87a12hcdzhliy1j8albfx2jqddaks4m86yfrcawm6vndn"))))
 25    (build-system go-build-system)
 26    (arguments
 27     (list
 28      #:import-path "github.com/aymerick/raymond"
 29      #:phases
 30      #~(modify-phases %standard-phases
 31          ;; Replace vendored mustache version with the one from 'inputs'.
 32          (add-before 'check 'supply-mustache
 33            (lambda* (#:key inputs import-path #:allow-other-keys)
 34              (let ((mustache (string-append "src/" import-path "/mustache")))
 35                (delete-file-recursively mustache)
 36                (copy-recursively #$(this-package-input "mustache-specs")
 37                                  mustache)))))))
 38    (inputs `(("mustache-specs" ,(origin
 39                                   (method git-fetch)
 40                                   (uri (git-reference (url
 41                                                        "https://github.com/mustache/spec")
 42                                                       (commit
 43                                                        "83b0721610a4e11832e83df19c73ace3289972b9")))
 44                                   (sha256 (base32
 45                                            "1g2f6hi04vkxrk53ixzm7yvkg5v8m00dh9nrkh9lxnx8aw824y80"))))))
 46    (propagated-inputs (list go-gopkg-in-yaml-v2))
 47    (home-page "https://github.com/aymerick/raymond")
 48    (synopsis "Handlebars for Go")
 49    (description
 50     "Provides a minimal templating engine for Go, inspired by the
 51Mustache-compatible Handlebars library from the Javascript ecosystem.")
 52    (license license:expat)))
 53
 54(define-public go-github-com-gosimple-slug
 55  (package
 56    (name "go-github-com-gosimple-slug")
 57    (version "1.12.0")
 58    (source
 59     (origin
 60       (method git-fetch)
 61       (uri (git-reference
 62             (url "https://github.com/gosimple/slug")
 63             (commit (string-append "v" version))))
 64       (file-name (git-file-name name version))
 65       (sha256
 66        (base32 "15gk6hdd8kjfl0srlf3gnjq34m64as1s6pjv7paaxd1zvrcml46y"))))
 67    (build-system go-build-system)
 68    (arguments
 69     (list
 70      #:import-path "github.com/gosimple/slug"))
 71    (propagated-inputs (list go-github-com-gosimple-unidecode))
 72    (home-page "https://github.com/gosimple/slug")
 73    (synopsis "URL-friendly slugify with multiple language support")
 74    (description "Generates slug from Unicode string for use in URLs.")
 75    (license license:mpl2.0)))
 76
 77(define-public go-github-com-mvdan-xurls
 78  (package
 79    (name "go-github-com-mvdan-xurls")
 80    (version "1.1.0")
 81    (source
 82     (origin
 83       (method git-fetch)
 84       (uri (git-reference
 85             (url "https://github.com/mvdan/xurls")
 86             (commit (string-append "v" version))))
 87       (file-name (git-file-name name version))
 88       (sha256
 89        (base32 "05q4nqbpgfb0a35sn22rn9mlag2ks4cgwb54dx925hipp6zgj1hx"))))
 90    (build-system go-build-system)
 91    (arguments
 92     (list
 93      #:import-path "github.com/mvdan/xurls"))
 94    (propagated-inputs (list go-golang-org-x-net))
 95    (home-page "https://github.com/mvdan/xurls")
 96    (synopsis "Extracts URLs from text")
 97    (description
 98     "Xurls extracts urls from plain text using regular expressions.  It can
 99be used as both a binary and a library.")
100    (license license:bsd-3)))
101
102(define-public go-github-com-alecthomas-kong-0.5.0
103  (package
104    (inherit go-github-com-alecthomas-kong)
105    (name "go-github-com-alecthomas-kong")
106    (version "0.5.0")
107    (source
108     (origin
109       (method git-fetch)
110       (uri (git-reference
111             (url "https://github.com/alecthomas/kong")
112             (commit (string-append "v" version))))
113       (file-name (git-file-name name version))
114       (sha256
115        (base32 "1lk4nb8ilvy0l5szj4s6wnz716vlz0v253423ykmph5l6bmips1k"))))
116    (arguments
117     (list
118      #:tests? #f
119      #:import-path "github.com/alecthomas/kong"))
120    (propagated-inputs (list go-github-com-alecthomas-repr
121                             go-github-com-pkg-errors))))
122
123(define-public go-github-com-fatih-color-1.13.0
124  (package
125    (inherit go-github-com-fatih-color)
126    (name "go-github-com-fatih-color")
127    (version "1.13.0")
128    (source
129     (origin
130       (method git-fetch)
131       (uri (git-reference
132             (url "https://github.com/fatih/color")
133             (commit (string-append "v" version))))
134       (file-name (git-file-name name version))
135       (sha256
136        (base32 "029qkxsdpblhrpgbv4fcmqwkqnjhx08hwiqp19pd7zz6l8a373ay"))))
137    (arguments
138     (list
139      #:import-path "github.com/fatih/color"
140      #:test-flags
141      #~(list "-vet=off")))))
142
143(define-public go-github-com-gosimple-unidecode
144  (package
145    (name "go-github-com-gosimple-unidecode")
146    (version "1.0.1")
147    (source
148     (origin
149       (method git-fetch)
150       (uri (git-reference
151             (url "https://github.com/gosimple/unidecode")
152             (commit (string-append "v" version))))
153       (file-name (git-file-name name version))
154       (sha256
155        (base32 "1dxdddn744l0s1lr006s2a4k02w6qx8j3k31c7sfflh7wvwzcdzx"))))
156    (build-system go-build-system)
157    (arguments
158     (list
159      #:import-path "github.com/gosimple/unidecode"))
160    (home-page "https://github.com/gosimple/unidecode")
161    (synopsis "Unicode transliterator for Go")
162    (description
163     "Package unidecode implements a unicode transliterator which
164replaces non-ASCII characters with their ASCII approximations.")
165    (license license:asl2.0)))
166
167(define-public go-github-com-rvflash-elapsed
168  (package
169    (name "go-github-com-rvflash-elapsed")
170    (version "0.2.0")
171    (source
172     (origin
173       (method git-fetch)
174       (uri (git-reference
175             (url "https://github.com/rvflash/elapsed")
176             (commit (string-append "v" version))))
177       (file-name (git-file-name name version))
178       (sha256
179        (base32 "1jawknvv51k1awlzpyr2qc1s75s1fg3l40c0zhixp1sc98hl434c"))))
180    (build-system go-build-system)
181    (arguments
182     (list
183      #:import-path "github.com/rvflash/elapsed"))
184    (home-page "https://github.com/rvflash/elapsed")
185    (synopsis "Calculates the elapsed time for a given date")
186    (description "This package can be used to return the elapsed time since a
187given time in a human-readable format.")
188    (license license:expat)))
189
190(define-public go-github-com-tj-go-naturaldate
191  (package
192    (name "go-github-com-tj-go-naturaldate")
193    (version "1.3.0")
194    (source
195     (origin
196       (method git-fetch)
197       (uri (git-reference
198             (url "https://github.com/tj/go-naturaldate")
199             (commit (string-append "v" version))))
200       (file-name (git-file-name name version))
201       (sha256
202        (base32 "12d7nf1jd7nk9r8ifn1hr21a7m4yb1garmiw2grrsi5zsqsh2jb1"))))
203    (build-system go-build-system)
204    (arguments
205     (list
206      #:import-path "github.com/tj/go-naturaldate"))
207    (propagated-inputs (list go-github-com-tj-assert))
208    (home-page "https://github.com/tj/go-naturaldate")
209    (synopsis "Provides natural date time parsing")
210    (description
211     "This package was designed for parsing human-friendly relative
212date/time ranges.")
213    (license license:expat)))
214
215(define-public go-github-com-tliron-kutil
216  (package
217    (name "go-github-com-tliron-kutil")
218    (version "0.1.59")
219    (source
220     (origin
221       (method git-fetch)
222       (uri (git-reference
223             (url "https://github.com/tliron/go-kutil")
224             (commit (string-append "v" version))))
225       (file-name (git-file-name name version))
226       (sha256
227        (base32 "07lhzgpsi96icdya874xmfd1ymg4s4y09s7m7h398aryn7hbysyg"))))
228    (build-system go-build-system)
229    (arguments
230     (list
231      #:skip-build? #t
232      #:tests? #f ;TODO: requires packaging a lot of additional libraries.
233      #:import-path "github.com/tliron/kutil"))
234    (home-page "https://github.com/tliron/go-kutil")
235    (synopsis "Utility library for Go")
236    (description "This package provides a collection of Go utilities.")
237    (license license:asl2.0)))
238
239(define-public go-github-com-tliron-glsp
240  (package
241    (name "go-github-com-tliron-glsp")
242    (version "0.1.1")
243    (source
244     (origin
245       (method git-fetch)
246       (uri (git-reference
247             (url "https://github.com/tliron/glsp")
248             (commit (string-append "v" version))))
249       (file-name (git-file-name name version))
250       (sha256
251        (base32 "0vz4idndpcxrkjck6m0azdg8zsgcxcchf0ldhnkr8fj3z2sllljr"))))
252    (build-system go-build-system)
253    (arguments
254     (list
255      #:import-path "github.com/tliron/glsp"))
256    (propagated-inputs (list go-github-com-sasha-s-go-deadlock
257                             go-github-com-tliron-kutil
258                             go-github-com-sourcegraph-jsonrpc2
259                             go-github-com-pkg-errors
260                             go-github-com-gorilla-websocket
261                             go-golang-org-x-term
262                             go-golang-org-x-crypto
263                             go-github-com-zchee-color))
264    (home-page "https://github.com/tliron/glsp")
265    (synopsis "Language Server Protocol SDK for Go")
266    (description
267     "Implementation of the @acronym{LSP, language server protocol}
268for Go, allowing the creating of custom language servers.")
269    (license license:asl2.0)))
270
271(define-public go-github-com-yuin-goldmark-meta
272  (package
273    (name "go-github-com-yuin-goldmark-meta")
274    (version "1.1.0")
275    (source
276     (origin
277       (method git-fetch)
278       (uri (git-reference
279             (url "https://github.com/yuin/goldmark-meta")
280             (commit (string-append "v" version))))
281       (file-name (git-file-name name version))
282       (sha256
283        (base32 "07dnwpkcifk9lw25ncflwdzmp8xqwbsbq0bnw3v7ljz9i8zi3ya3"))))
284    (build-system go-build-system)
285    (arguments
286     (list
287      #:import-path "github.com/yuin/goldmark-meta"))
288    (propagated-inputs (list go-gopkg-in-yaml-v2 go-github-com-yuin-goldmark))
289    (home-page "https://github.com/yuin/goldmark-meta")
290    (synopsis "YAML metadata extension for the goldmark markdown parser")
291    (description
292     "Extension for the @code{goldmark} markdown parser which enables
293defining document metadata in the YAML format.")
294    (license license:expat)))
295
296(define-public go-github-com-zchee-color
297  (package
298    (name "go-github-com-zchee-color")
299    (version "2.0.6")
300    (source
301     (origin
302       (method git-fetch)
303       (uri (git-reference
304             (url "https://github.com/zchee/color")
305             (commit (string-append "v" version))))
306       (file-name (git-file-name name version))
307       (sha256
308        (base32 "0im301c9m5702lsv3qvzwmx943m9hmrpb2670zfv0z14cm7fqhls"))))
309    (build-system go-build-system)
310    (arguments
311     (list
312      #:test-flags
313      #~(list "-vet=off")
314      #:import-path "github.com/zchee/color/v2"))
315    (propagated-inputs (list go-github-com-mattn-go-isatty
316                             go-github-com-mattn-go-colorable))
317    (home-page "https://github.com/zchee/color")
318    (synopsis "Color package for Go")
319    (description
320     "Package color is an ANSI color package to output colorized or
321SGR defined output to the standard output.  The API can be used in several way,
322pick one that suits you.")
323    (license license:expat)))
324
325(define-public go-github-com-zk-org-pretty
326  (package
327    (name "go-github-com-zk-org-pretty")
328    (version "0.2.4")
329    (source
330     (origin
331       (method git-fetch)
332       (uri (git-reference
333             (url "https://github.com/zk-org/pretty")
334             (commit (string-append "v" version))))
335       (file-name (git-file-name name version))
336       (sha256
337        (base32 "086zcjamclnn3y9w4ww88ik9avwihbxk7h08vk7686643i1zij96"))))
338    (build-system go-build-system)
339    (arguments
340     (list
341      #:import-path "github.com/zk-org/pretty"))
342    (propagated-inputs (list go-github-com-rogpeppe-go-internal
343                             go-github-com-kr-text))
344    (home-page "https://github.com/zk-org/pretty")
345    (synopsis "Pretty printing for Go values")
346    (description "Provides a pretty printing library for Go values.")
347    (license license:expat)))
348
349(define-public go-gopkg-in-djherbis-times-v1
350  (package
351    (name "go-gopkg-in-djherbis-times-v1")
352    (version "1.3.0")
353    (source
354     (origin
355       (method git-fetch)
356       (uri (git-reference
357             (url "https://github.com/djherbis/times")
358             (commit (string-append "v" version))))
359       (file-name (git-file-name name version))
360       (sha256
361        (base32 "1dk087l9c927f90zrsmyxxfx5i980r952qw47j9srq2q7dd0b4ni"))
362       (modules '((guix build utils)))
363       ;; Fix import path for itself in the example code (build by 'check).
364       (snippet '(substitute* "example/main.go"
365                   (("github.com/djherbis/times")
366                    "gopkg.in/djherbis/times.v1")))))
367    (build-system go-build-system)
368    (arguments
369     (list
370      #:import-path "gopkg.in/djherbis/times.v1"))
371    (home-page "https://github.com/djherbis/times")
372    (synopsis "File times for Go")
373    (description
374     "This package allows access different file time metadata from Go.")
375    (license license:expat)))
376
377(define-public zk
378  (package
379    (name "zk")
380    (version "0.15.1")
381    (source
382     (origin
383       (method git-fetch)
384       (uri (git-reference
385             (url "https://github.com/zk-org/zk/")
386             (commit (string-append "v" version))))
387       (file-name (git-file-name name version))
388       (sha256
389        (base32 "1jm18qp4sgfb92c420jc8ylfjwc6shv29fb1jc4z2g03dqcbg2l7"))
390       (modules '((guix build utils)))
391       (snippet
392        ;; Remove the sqlite database tests as they require a dependency on
393        ;; github.com/go-testfixtures/testfixtures/v3 which itself requires
394        ;; several new dependencies to be added to Guix.
395        #~(begin
396            (for-each delete-file
397                      (find-files "internal/adapter/sqlite" ".*_test\\.go$"))))))
398    (build-system go-build-system)
399    (arguments
400     (list
401      #:install-source? #f
402      #:import-path "github.com/zk-org/zk"
403      #:test-flags
404      #~(list "-vet=off" "-skip"
405              (string-join (list
406                            ;; Test matches $HOME against the /etc/passwd entry.
407                            ;; Doesn't work on Guix because of HOME=/homeless-shelter.
408                            "TestExpandPath") "|"))
409      #:phases
410      #~(modify-phases %standard-phases
411          (add-after 'unpack 'fix-paths
412            (lambda* (#:key inputs import-path #:allow-other-keys)
413              (substitute* (string-append "src/" import-path
414                                          "/internal/adapter/fzf/fzf.go")
415                (("\"fzf\"")
416                 (string-append
417                   "\"" (search-input-file inputs "/bin/fzf") "\""))))))))
418    (inputs (list fzf))
419    (propagated-inputs (list go-github-com-aymerick-raymond
420                             go-github-com-alecaivazis-survey-v2
421                             go-github-com-alecthomas-kong-0.5.0
422                             go-github-com-bmatcuk-doublestar-v4
423                             go-github-com-fatih-color-1.13.0
424                             go-github-com-google-go-cmp
425                             go-github-com-gosimple-slug
426                             go-github-com-kballard-go-shellquote
427                             go-github-com-lestrrat-go-strftime
428                             go-github-com-mattn-go-isatty
429                             go-github-com-mattn-go-sqlite3
430                             go-github-com-mvdan-xurls
431                             go-github-com-pelletier-go-toml
432                             go-github-com-pkg-errors
433                             go-github-com-relvacode-iso8601
434                             go-github-com-rvflash-elapsed
435                             go-github-com-schollz-progressbar-v3
436                             go-github-com-tj-go-naturaldate
437                             go-github-com-tliron-glsp
438                             go-github-com-tliron-kutil
439                             go-github-com-yuin-goldmark
440                             go-github-com-yuin-goldmark-meta
441                             go-github-com-zk-org-pretty
442                             go-gopkg-in-djherbis-times-v1
443                             go-github-com-alecaivazis-survey-v2))
444    (home-page "https://zk-org.github.io/zk")
445    (synopsis "Plain text note-taking assistant")
446    (description
447     "Command-line tooling for helping you to maintain a plain text
448Zettelkasten or personal wiki.  Based on the Markdown markup language.")
449    (license license:gpl3)))