projects/guix·blob dexed · refs

1194 lines · 48.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Matthew Jordan <[email protected]>
3;;; Copyright © 2016, 2017 Alex Griffin <[email protected]>
4;;; Copyright © 2016 Christopher Baines <[email protected]>
5;;; Copyright © 2017 Stefan Reichör <[email protected]>
6;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2018 Benjamin Slade <[email protected]>
8;;; Copyright © 2019 Collin J. Doering <[email protected]>
9;;; Copyright © 2020, 2022 Michael Rohleder <[email protected]>
10;;; Copyright © 2020 aecepoglu <[email protected]>
11;;; Copyright © 2020 Dion Mendel <[email protected]>
12;;; Copyright © 2021 Brice Waegeneire <[email protected]>
13;;; Copyright © 2021 Alexandr Vityazev <[email protected]>
14;;; Copyright © 2021 Xinglu Chen <[email protected]>
15;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
16;;; Copyright © 2021 Wiktor Żelazny <[email protected]>
17;;; Copyright © 2022 Jose G Perez Taveras <[email protected]>
18;;; Copyright © 2023 Timo Wilken <[email protected]>
19;;; Copyright © 2023, 2025 Camilo Q.S. (Distopico) <[email protected]>
20;;; Copyright © 2023 Zheng Junjie <[email protected]>
21;;; Copyright © 2024 Artyom V. Poptsov <[email protected]>
22;;; Copyright © 2024 Brian Kubisiak <[email protected]>
23;;; Copyright © 2024 Jordan Moore <[email protected]>
24;;; Copyright © 2025 Gabriel Santos <[email protected]>
25;;; Copyright © 2025 Skylar Hill <[email protected]>
26;;;
27;;; This file is part of GNU Guix.
28;;;
29;;; GNU Guix is free software; you can redistribute it and/or modify it
30;;; under the terms of the GNU General Public License as published by
31;;; the Free Software Foundation; either version 3 of the License, or (at
32;;; your option) any later version.
33;;;
34;;; GNU Guix is distributed in the hope that it will be useful, but
35;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37;;; GNU General Public License for more details.
38;;;
39;;; You should have received a copy of the GNU General Public License
40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42(define-module (gnu packages shellutils)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix gexp)
45 #:use-module (guix utils)
46 #:use-module (guix packages)
47 #:use-module (guix download)
48 #:use-module (guix git-download)
49 #:use-module (guix build-system cargo)
50 #:use-module (guix build-system copy)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system go)
53 #:use-module ((guix build-system python) #:select (pypi-uri))
54 #:use-module (guix build-system pyproject)
55 #:use-module (gnu packages admin)
56 #:use-module (gnu packages autotools)
57 #:use-module (gnu packages base)
58 #:use-module (gnu packages bison)
59 #:use-module (gnu packages check)
60 #:use-module (gnu packages cmake)
61 #:use-module (gnu packages flex)
62 #:use-module (gnu packages golang-build)
63 #:use-module (gnu packages golang-check)
64 #:use-module (gnu packages golang-xyz)
65 #:use-module (gnu packages libunistring)
66 #:use-module (gnu packages ncurses)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages pcre)
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages python)
71 #:use-module (gnu packages python-build)
72 #:use-module (gnu packages python-check)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages readline)
75 #:use-module (gnu packages ruby)
76 #:use-module (gnu packages ruby-check)
77 #:use-module (gnu packages ruby-xyz)
78 #:use-module (gnu packages shells)
79 #:use-module (gnu packages textutils)
80 #:use-module (gnu packages tmux)
81 #:use-module (gnu packages version-control)
82 #:use-module (gnu packages vim))
83
84(define-public ascii
85 (package
86 (name "ascii")
87 (version "3.30")
88 (source (origin
89 (method url-fetch)
90 (uri (string-append "http://www.catb.org/~esr/ascii/"
91 "ascii-" version ".tar.gz"))
92 (sha256
93 (base32
94 "0hr4k4mvnq4zpjxdjkvbbyzz7c1iwxhfal1hz0mdm1qv7sbxqbzd"))))
95 (build-system gnu-build-system)
96 (arguments
97 (list #:make-flags
98 #~(list (string-append "CC=" #$(cc-for-target))
99 (string-append "PREFIX=" #$output))
100 #:phases
101 #~(modify-phases %standard-phases
102 (delete 'configure)
103 (add-before 'install 'create-directories
104 (lambda* (#:key outputs #:allow-other-keys)
105 (let* ((out (assoc-ref outputs "out"))
106 (bin (string-append out "/bin"))
107 (man1 (string-append out "/share/man/man1")))
108 (mkdir-p bin)
109 (mkdir-p man1)))))
110 #:tests? #f))
111 (home-page "http://www.catb.org/~esr/ascii/")
112 (synopsis "ASCII name and synonym chart")
113 (description
114 "The @code{ascii} utility provides easy conversion between various byte
115representations and the American Standard Code for Information Interchange
116(ASCII) character table. It knows about a wide variety of hex, binary, octal,
117Teletype mnemonic, ISO/ECMA code point, slang names, XML entity names, and
118other representations. Given any one on the command line, it will try to
119display all others. Called with no arguments it displays a handy small ASCII
120chart.")
121 (license license:bsd-2)))
122
123(define-public boxes
124 (package
125 (name "boxes")
126 (version "2.3.1")
127 (source (origin
128 (method git-fetch)
129 (uri (git-reference
130 (url "https://github.com/ascii-boxes/boxes")
131 (commit (string-append "v" version))))
132 (file-name (git-file-name name version))
133 (sha256
134 (base32
135 "028vg9h3vxz3icy7hmxgyqhn62953h1ls6bxwbhdwhl1lpj5py3n"))))
136 (build-system gnu-build-system)
137 (arguments
138 `(#:test-target "utest"
139 #:make-flags (list (string-append "GLOBALCONF="
140 (assoc-ref %outputs "out")
141 "/etc/boxes-config"))
142 #:modules
143 ((ice-9 match)
144 ,@%default-gnu-modules)
145 #:phases
146 (modify-phases %standard-phases
147 (delete 'configure)
148 (replace 'install
149 (lambda* (#:key outputs #:allow-other-keys)
150 (let ((out (assoc-ref outputs "out")))
151 (for-each (match-lambda
152 ((source target)
153 (install-file source
154 (string-append out "/" target))))
155 '(("out/boxes" "bin/")
156 ("doc/boxes.1" "share/man/man1/")
157 ("boxes-config" "etc/")))))))))
158 (native-inputs
159 (list bison flex cmocka
160 ;; For the tests.
161 xxd))
162 (inputs
163 (list ncurses libunistring pcre2))
164 (home-page "https://boxes.thomasjensen.com")
165 (synopsis "Command line ASCII boxes")
166 (description
167 "This command-line filter program draws ASCII-art boxes around your input
168text.")
169 (license license:gpl2)))
170
171(define-public zsh-autopair
172 (package
173 (name "zsh-autopair")
174 (version "1.0")
175 (home-page "https://github.com/hlissner/zsh-autopair")
176 (source (origin
177 (method git-fetch)
178 (uri (git-reference
179 (url "https://github.com/hlissner/zsh-autopair.git")
180 (commit (string-append "v" version))))
181 (file-name (git-file-name name version))
182 (sha256
183 (base32
184 "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1"))))
185 (build-system copy-build-system)
186 (arguments
187 '(#:install-plan '(("autopair.zsh"
188 "/share/zsh/plugins/zsh-autopair/zsh-autopair.zsh"))))
189 (synopsis "Auto-close and delete matching delimiters in Zsh")
190 (description
191 "This Zsh plugin auto-closes, deletes, and skips over matching delimiters
192in Zsh intelligently.")
193 (license license:expat)))
194
195(define-public zsh-autosuggestions
196 (package
197 (name "zsh-autosuggestions")
198 (version "0.7.0")
199 (source (origin
200 (method git-fetch)
201 (uri (git-reference
202 (url "https://github.com/zsh-users/zsh-autosuggestions")
203 (commit (string-append "v" version))))
204 (file-name (git-file-name name version))
205 (sha256
206 (base32
207 "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98"))))
208 (build-system gnu-build-system)
209 (native-inputs
210 (list ruby
211 ruby-pry
212 ruby-rspec
213 ruby-rspec-wait
214 tmux
215 zsh))
216 (arguments
217 (list
218 #:phases
219 #~(modify-phases %standard-phases
220 (add-after 'unpack 'patch-tests
221 (lambda _
222 ;; Failing tests since tmux-3.2a
223 (delete-file "spec/options/buffer_max_size_spec.rb")))
224 (delete 'configure)
225 (replace 'check ; Tests use ruby's bundler; instead execute rspec directly.
226 (lambda _
227 (setenv "TMUX_TMPDIR" (getenv "TMPDIR"))
228 (setenv "SHELL" (which "zsh"))
229 (invoke "rspec")))
230 (replace 'install
231 (lambda* (#:key outputs #:allow-other-keys)
232 (let* ((out (assoc-ref outputs "out"))
233 (zsh-plugins
234 (string-append out "/share/zsh/plugins/zsh-autosuggestions")))
235 (invoke "make" "all")
236 (install-file "zsh-autosuggestions.zsh" zsh-plugins)))))))
237 (home-page "https://github.com/zsh-users/zsh-autosuggestions")
238 (synopsis "Fish-like autosuggestions for zsh")
239 (description
240 "Fish-like fast/unobtrusive autosuggestions for zsh. It suggests commands
241as you type.")
242 (license license:expat)))
243
244(define-public zsh-completions
245 (package
246 (name "zsh-completions")
247 (version "0.34.0")
248 (home-page "https://github.com/zsh-users/zsh-completions")
249 (source (origin
250 (method git-fetch)
251 (uri (git-reference
252 (url home-page)
253 (commit version)))
254 (file-name (git-file-name name version))
255 (sha256
256 (base32
257 "0jjgvzj3v31yibjmq50s80s3sqi4d91yin45pvn3fpnihcrinam9"))))
258 (build-system copy-build-system)
259 (arguments
260 '(#:install-plan '(("src/" "share/zsh/site-functions/")
261 ("README.md" "share/doc/zsh-completions/"))))
262 (synopsis "Additional completion definitions for Zsh")
263 (description
264 "This projects aims at gathering/developing new completion scripts that
265are not available in Zsh yet. The scripts may be contributed to the Zsh
266project when stable enough.")
267 (license (license:non-copyleft "file://LICENSE"
268 "Custom BSD-like, permissive, non-copyleft license."))))
269
270(define-public zsh-history-substring-search
271 (package
272 (name "zsh-history-substring-search")
273 (version "1.0.2")
274 (home-page "https://github.com/zsh-users/zsh-history-substring-search")
275 (source (origin
276 (method git-fetch)
277 (uri (git-reference
278 (url home-page)
279 (commit (string-append "v" version))))
280 (file-name (git-file-name name version))
281 (sha256
282 (base32
283 "0y8va5kc2ram38hbk2cibkk64ffrabfv1sh4xm7pjspsba9n5p1y"))))
284 (build-system copy-build-system)
285 (arguments
286 '(#:install-plan '(("zsh-history-substring-search.plugin.zsh"
287 "share/zsh/plugins/zsh-history-substring-search/")
288 ("zsh-history-substring-search.zsh"
289 "share/zsh/plugins/zsh-history-substring-search/")
290 ("README.md" "share/doc/zsh-history-substring-search/"))))
291 (synopsis "ZSH port of Fish history search (up arrow)")
292 (description
293 "This is a clean-room implementation of the Fish shell's history search
294feature, where you can type in any part of any command from history and then
295press chosen keys, such as the UP and DOWN arrows, to cycle through matches.")
296 (license license:bsd-3)))
297
298(define-public zsh-syntax-highlighting
299 (package
300 (name "zsh-syntax-highlighting")
301 (version "0.7.1")
302 (source (origin
303 (method git-fetch)
304 (uri (git-reference
305 (url "https://github.com/zsh-users/zsh-syntax-highlighting")
306 (commit version)))
307 (file-name (git-file-name name version))
308 (sha256
309 (base32
310 "039g3n59drk818ylcyvkciv8k9mf739cv6v4vis1h9fv9whbcmwl"))))
311 (build-system gnu-build-system)
312 (native-inputs
313 (list zsh))
314 (arguments
315 ;; FIXME: Tests fail when running test regexp
316 ;; there is no pcre module in the Guix zsh package
317 `(#:tests? #f
318 #:phases
319 (modify-phases %standard-phases
320 (delete 'configure)
321 (add-after 'unpack 'patch-paths
322 (lambda* (#:key outputs #:allow-other-keys)
323 (let ((out (assoc-ref outputs "out")))
324 (substitute* "Makefile"
325 (("/usr/local") out)
326 (("share/\\$\\(NAME\\)") "share/zsh/plugins/$(NAME)")))))
327 (add-after 'patch-paths 'make-writable
328 (lambda _
329 (for-each make-file-writable
330 '("docs/highlighters.md"
331 "README.md"))))
332 (add-before 'build 'add-all-md
333 (lambda _
334 (invoke "make" "all")))
335 (replace 'check
336 (lambda* (#:key tests? #:allow-other-keys)
337 (when tests?
338 (invoke "make" "test")
339 (invoke "make" "perf")))))))
340 (home-page "https://github.com/zsh-users/zsh-syntax-highlighting")
341 (synopsis "Fish shell-like syntax highlighting for Zsh")
342 (description
343 "This package provides syntax highlighting for Zsh. It enables
344highlighting of commands whilst they are typed at a Zsh prompt into an
345interactive terminal. This helps in reviewing commands before running them,
346particularly in catching syntax errors.")
347 (license license:bsd-3)))
348
349(define-public zsh-vi-mode
350 (package
351 (name "zsh-vi-mode")
352 (version "0.11.0")
353 (home-page "https://github.com/jeffreytse/zsh-vi-mode")
354 (source
355 (origin
356 (method git-fetch)
357 (uri (git-reference
358 (url "https://github.com/jeffreytse/zsh-vi-mode")
359 (commit (string-append "v" version))))
360 (file-name (git-file-name name version))
361 (sha256
362 "0bs5p6p5846hcgf3rb234yzq87rfjs18gfha9w0y0nf5jif23dy5")))
363 (build-system copy-build-system)
364 (arguments
365 (list
366 #:install-plan
367 #~'(("zsh-vi-mode.zsh" "share/zsh/plugins/zsh-vi-mode/")
368 ("zsh-vi-mode.plugin.zsh" "share/zsh/plugins/zsh-vi-mode/"))))
369 (synopsis "Plugin to improve vi keybindings in zsh")
370 (description "This package provides a zsh vimkey plugin with more features,
371which more closely matches the standard behavior of vim.")
372 (license license:expat)))
373
374(define-public grml-zsh-config
375 (package
376 (name "grml-zsh-config")
377 (version "0.19.6")
378 (source (origin
379 (method url-fetch)
380 (uri (string-append
381 "https://deb.grml.org/pool/main/g/grml-etc-core/grml-etc-core_"
382 version ".tar.gz"))
383 (sha256
384 (base32
385 "1k1m2fbmvw73qy9mc6k2ygjg6zz8h7nn3d9pvj6jbjadnx4pz770"))))
386 (build-system copy-build-system)
387 (arguments
388 (list
389 #:phases
390 #~(modify-phases
391 %standard-phases
392 (add-before 'install 'make-doc
393 (lambda _ (with-directory-excursion "doc" (invoke "make")))))
394 #:install-plan
395 #~'(("etc/skel/.zshrc" "etc/skel/.zshrc")
396 ("etc/zsh/keephack" "etc/zsh/keephack")
397 ("etc/zsh/zshrc" "etc/zsh/zshrc")
398 ("doc/grmlzshrc.5" "share/man/man5/grmlzshrc.5"))))
399 (native-inputs (list txt2tags))
400 (home-page "https://grml.org/zsh/")
401 (synopsis "Grml's zsh configuration")
402 (description "This package provides an interactive setup for zsh
403preconfigured by the Grml project.")
404 (license license:gpl2)))
405
406(define-public sh-z
407 (package
408 (name "sh-z")
409 (version "1.11")
410 (source (origin
411 (method git-fetch)
412 (uri (git-reference
413 (url "https://github.com/rupa/z")
414 (commit (string-append "v" version))))
415 (file-name (git-file-name name version))
416 (sha256
417 (base32
418 "13zbgkj6y0qhvn5jpkrqbd4jjxjr789k228iwma5hjfh1nx7ghyb"))))
419 (build-system gnu-build-system)
420 (arguments
421 `(#:tests? #f ; No tests provided
422 #:phases
423 (modify-phases %standard-phases
424 (delete 'configure)
425 (delete 'build)
426 (replace 'install
427 (lambda* (#:key outputs #:allow-other-keys)
428 (let* ((out (assoc-ref outputs "out"))
429 (man (string-append out "/share/man/man1"))
430 (bin (string-append out "/bin")))
431 (install-file "z.sh" bin)
432 (chmod (string-append bin "/z.sh") #o755)
433 (install-file "z.1" man)
434 #t))))))
435 (synopsis "Jump about directories")
436 (description
437 "Tracks your most used directories, based on ``frecency''. After a short
438learning phase, z will take you to the most ``frecent'' directory that matches
439all of the regexes given on the command line in order.")
440 (home-page "https://github.com/rupa/z")
441 (license license:expat)))
442
443(define-public shfmt
444 (package
445 (name "shfmt")
446 (version "3.12.0")
447 (source
448 (origin
449 (method git-fetch)
450 (uri (git-reference
451 (url "https://github.com/mvdan/sh")
452 (commit (string-append "v" version))))
453 (file-name (git-file-name name version))
454 (sha256
455 (base32 "11rlx3l37aspd9674xdisw394bdly0yb38asqxaz4riadgj0vbfx"))
456 (modules '((guix build utils)))
457 (snippet
458 #~(begin
459 ;; It fails during check phase, looks like a MVP: gosh is a proof
460 ;; of concept shell built on top of [interp].
461 (delete-file-recursively "cmd/gosh")))))
462 (build-system go-build-system)
463 (arguments
464 (list
465 #:install-source? #f
466 #:import-path "mvdan.cc/sh/v3/cmd/shfmt"
467 #:unpack-path "mvdan.cc/sh/v3"
468 #:test-flags
469 ;; Tests fail for these groups unable to set locale.
470 #~(list "-skip" (string-join
471 (list "FuzzQuote"
472 "TestKillTimeout"
473 "TestParseBashConfirm"
474 "TestParseErrBashConfirm"
475 "TestRunnerRun"
476 "TestRunnerRunConfirm")
477 "|"))
478 #:test-subdirs #~(list "../../...") ;test the whole libary
479 #:phases
480 #~(modify-phases %standard-phases
481 (add-after 'unpack 'set-version
482 (lambda* (#:key unpack-path #:allow-other-keys)
483 (with-directory-excursion (string-append "src/" unpack-path)
484 (let ((fixed-version (string-append #$version " (GNU Guix)")))
485 ;; shfmt uses modules to look up the version at runtime;
486 ;; since our build system does not yet support modules,
487 ;; inject the version string here instead
488 (substitute* "cmd/shfmt/main.go"
489 (("version = \"\\(devel\\)\"")
490 (format #f "version = \"~a\"" fixed-version)))
491 (substitute* "cmd/shfmt/testdata/script/flags.txtar"
492 (("devel\\|v3") #$version)))))))))
493 (native-inputs
494 (list go-github-com-creack-pty
495 go-github-com-go-quicktest-qt
496 go-github-com-google-go-cmp
497 go-github-com-google-renameio-v2
498 go-github-com-rogpeppe-go-internal-1.14
499 go-golang-org-x-sys
500 go-golang-org-x-term
501 go-mvdan-cc-editorconfig))
502 (home-page "https://github.com/mvdan/sh")
503 (synopsis "Shell formatter with bash support")
504 (description
505 "This package provides a shell formatter. Supports
506@url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html,
507POSIX Shell}, @url{https://www.gnu.org/software/bash/, Bash}, and
508@url{http://www.mirbsd.org/mksh.htm, mksh}.")
509 (license license:bsd-3)))
510
511(define-public starship
512 (package
513 (name "starship")
514 (version "1.21.1")
515 (source
516 (origin
517 (method url-fetch)
518 (uri (crate-uri "starship" version))
519 (file-name (string-append name "-" version ".tar.gz"))
520 (sha256
521 (base32 "1ikdy6jwlc36add55acxlba6f009dln9iyz368c1ndbfpgn4n42g"))))
522 (build-system cargo-build-system)
523 (arguments
524 (list
525 #:install-source? #f
526 #:phases
527 #~(modify-phases %standard-phases
528 (add-after 'install 'install-completions
529 (lambda* (#:key native-inputs outputs #:allow-other-keys)
530 (let* ((out (assoc-ref outputs "out"))
531 (starship-bin
532 (if #$(%current-target-system)
533 (search-input-file native-inputs "/bin/starship")
534 (string-append out "/bin/starship")))
535 (share (string-append out "/share"))
536 (bash-completion-dir
537 (string-append out "/share/bash-completion/completions"))
538 (zsh-completion-dir
539 (string-append share "/zsh/site-functions/"))
540 (fish-completion-dir
541 (string-append share "/fish/vendor_completions.d/"))
542 (elvish-completion-dir
543 (string-append share "/elvish/lib")))
544 ;; Make the directories
545 (mkdir-p bash-completion-dir)
546 (mkdir-p zsh-completion-dir)
547 (mkdir-p fish-completion-dir)
548 (mkdir-p elvish-completion-dir)
549 ;; Use the built starship to generate the completions.
550 (with-output-to-file
551 (string-append bash-completion-dir "/starship")
552 (lambda _ (invoke starship-bin "completions" "bash")))
553 (with-output-to-file
554 (string-append zsh-completion-dir "/_starship")
555 (lambda _(invoke starship-bin "completions" "zsh")))
556 (with-output-to-file
557 (string-append fish-completion-dir "/starship.fish")
558 (lambda _ (invoke starship-bin "completions" "fish")))
559 (with-output-to-file
560 (string-append elvish-completion-dir "/starship")
561 (lambda _ (invoke starship-bin "completions" "elvish"))))))
562 ;; Some tests require a writable home directory
563 (add-after 'unpack 'patch-test-shell
564 (lambda* (#:key inputs #:allow-other-keys)
565 ;; search through the rust files and then replace `/bin/sh'
566 ;; with the path to the `/bin/sh' in the drv inputs
567 (let ((rust-files (find-files "." "\\.rs$")))
568 (for-each (lambda (file)
569 (substitute* file
570 (("/bin/sh")
571 (search-input-file inputs "/bin/sh"))))
572 rust-files))))
573 ;; Set "HOME" to be located inside the cwd so it is writable
574 ;; for tests checking for user-configs
575 (add-before 'check 'set-test-env-vars
576 (lambda _
577 (setenv "HOME"
578 (string-append (getcwd) "/.test-home")))))))
579 (inputs (cons cmake-minimal (cargo-inputs 'starship)))
580 (native-inputs
581 (append
582 (if (%current-target-system)
583 (list this-package)
584 '())
585 (list git-minimal)))
586 (home-page "https://starship.rs")
587 (synopsis
588 "The minimal, blazing-fast, and infinitely customizable prompt for any shell!")
589 (description
590 "This package provides The minimal, blazing-fast, and infinitely customizable
591prompt for any shell!
592
593@itemize
594@item Fast: it's fast - *really really* fast :rocket:
595@item Customizable: configure every aspect of your prompt
596@item Universal: works on any shell, on any operating system
597@item Intelligent: shows relevant information at a glance
598@item Feature rich: support for all your favorite tools
599@item Easy: quick to install - start using it in minutes
600@end itemize
601
602Note: users must have a nerd font installed and enabled in their terminal")
603 (license license:isc)))
604
605(define-public envstore
606 (package
607 (name "envstore")
608 (version "2.1")
609 (source
610 (origin
611 (method url-fetch)
612 (uri (string-append "https://finalrewind.org/projects/"
613 name "/" name "-" version ".tar.bz2"))
614 (sha256
615 (base32 "1x97lxad80m5blhdfanl5v2qzjwcgbij2i23701bn8mpyxsrqszi"))))
616 (build-system gnu-build-system)
617 (arguments
618 `(#:test-target "test"
619 #:make-flags (list "CC=gcc"
620 (string-append "PREFIX=" (assoc-ref %outputs "out")))
621 #:phases
622 (modify-phases %standard-phases
623 (delete 'configure))))
624 (home-page "https://finalrewind.org/projects/envstore/")
625 (synopsis "Save and restore environment variables")
626 (description "Envstore is a program for sharing environment variables
627between various shells or commands.")
628 (license license:wtfpl2)))
629
630(define-public trash-cli
631 (package
632 (name "trash-cli")
633 (version "0.24.5.26")
634 (source
635 (origin
636 (method git-fetch)
637 (uri (git-reference
638 (url "https://github.com/andreafrancia/trash-cli")
639 (commit version)))
640 (file-name (git-file-name name version))
641 (sha256
642 (base32 "1mqs3y9vbph33jsaa5hc0fhk80pklmsn8ylp979k9qj63fgqrnwn"))))
643 (build-system pyproject-build-system)
644 (arguments
645 (list
646 #:modules `((guix build pyproject-build-system)
647 (guix build utils)
648 (ice-9 match))
649 #:phases #~(modify-phases %standard-phases
650 (add-before 'build 'fix-setup.py
651 (lambda* (#:key outputs #:allow-other-keys)
652 (let ((bin (string-append #$output "/bin")))
653 (mkdir-p bin)
654 (substitute* "setup.py"
655 (("add_script\\('")
656 (string-append "add_script('" bin "/"))))))
657 (add-before 'wrap 'install-completions
658 (lambda _
659 (for-each
660 (lambda (binary)
661 (for-each
662 (match-lambda
663 ((shell . path)
664 (mkdir-p (dirname path))
665 (with-output-to-file path
666 (lambda _
667 (invoke
668 (string-append #$output "/bin/" binary)
669 "--print-completion" shell)))))
670 `(("bash" .
671 ,(format ;format string must be literal
672 #f "~a/share/bash-completion/completions/~a"
673 #$output binary))
674 ("zsh" .
675 ,(format #f "~a/share/zsh/site-functions/_~a"
676 #$output binary))
677 ("tcsh" .
678 ,(format #f "~a/etc/profile.d/~a.completion.csh"
679 #$output binary)))))
680 (list "trash"
681 "trash-empty"
682 "trash-list"
683 "trash-put"
684 "trash-restore"
685 "trash-rm")))))))
686 (native-inputs (list python-flexmock
687 python-mock
688 python-parameterized
689 python-pytest
690 python-setuptools
691 python-shtab
692 python-six
693 python-wheel))
694 (inputs (list coreutils))
695 (propagated-inputs (list python-psutil))
696 (home-page "https://github.com/andreafrancia/trash-cli")
697 (synopsis "Trash can management tool")
698 (description
699 "trash-cli is a command line utility for interacting with the
700FreeDesktop.org trash can used by GNOME, KDE, XFCE, and other common desktop
701environments. It can move files to the trash, and remove or list files that
702are already there.")
703 (license license:gpl2+)))
704
705(define-public tran
706 ;; There is no new release yet, but there are some changes in master brunch,
707 ;; see <https://github.com/kilobyte/tran/issues/4>.
708 (let ((commit "039df9529d5dfb8283edfb3c8b3cc16c01f0bfce")
709 (revision "0"))
710 (package
711 (name "tran")
712 ;; The latest upstream version seems to be "v5".
713 (version (git-version "5.0.0" revision commit))
714 (source
715 (origin
716 (method git-fetch)
717 (uri (git-reference
718 (url "https://github.com/kilobyte/tran")
719 (commit commit)))
720 (file-name (string-append name "-" version "-checkout"))
721 (sha256
722 (base32 "1kzr3lfhi5f8wpwjzrzlwkxjv9rasdr9ndjdns9kd16vsh0gl2rd"))))
723 (build-system gnu-build-system)
724 (arguments
725 (list
726 #:tests? #f ;no tests
727 #:phases
728 #~(modify-phases %standard-phases
729 (delete 'configure) ;no configure provided
730 (add-after 'unpack 'patch
731 (lambda _
732 (substitute* "tran"
733 (("my \\$DATA=\"data\"")
734 (format #f "my $DATA=\"~a/share/tran/data\"" #$output)))))
735 (replace 'build
736 (lambda _
737 (invoke "make")))
738 (delete 'strip)
739 (replace 'install
740 (lambda _
741 (install-file "tran" (string-append #$output "/bin/"))
742 (install-file "tran.1" (string-append
743 #$output "/share/man/man1/"))
744 (copy-recursively "data" (string-append
745 #$output "/share/tran/data/")))))))
746 (inputs (list perl))
747 (home-page "https://github.com/kilobyte/tran")
748 (synopsis "Transcription between character scripts")
749 (description
750 "This tool can transliterate/transcribe text both ways between the
751Latin script and other languages.")
752 (license license:expat))))
753
754(define-public direnv
755 (package
756 (name "direnv")
757 (version "2.37.1")
758 (source
759 (origin (method git-fetch)
760 (uri (git-reference
761 (url "https://github.com/direnv/direnv")
762 (commit (string-append "v" version))))
763 (file-name (git-file-name name version))
764 (sha256
765 (base32
766 "08wywbj5niqhpy6m4y8xw065w3rgpi8khfy5qzqfxr6752h66v7p"))))
767 (build-system go-build-system)
768 (arguments
769 (list #:install-source? #f
770 #:import-path "github.com/direnv/direnv"
771 #:phases
772 #~(modify-phases %standard-phases
773 (add-after 'install 'install-manpages
774 (lambda _
775 (let* ((man (string-append #$output "/share/man/man1")))
776 (mkdir-p man)
777 (with-directory-excursion "src/github.com/direnv/direnv"
778 (install-file "man/direnv.1" man)
779 (install-file "man/direnv-stdlib.1" man)
780 (install-file "man/direnv.toml.1" man)))))
781 (replace 'check
782 (lambda* (#:key tests? #:allow-other-keys)
783 (when tests?
784 (setenv "HOME" "/tmp")
785 (with-directory-excursion "src/github.com/direnv/direnv"
786 ;; The following file needs to be writable so it can be
787 ;; modified by the testsuite.
788 (make-file-writable "test/scenarios/base/.envrc")
789 ;; We need to manually run test because make test
790 ;; tries to use go modules
791 (invoke "go" "test" "./...")
792 ;; Clean up from the tests, especially so that the extra
793 ;; direnv executable that's generated is removed.
794 (invoke "make" "clean"))))))))
795 (native-inputs
796 (list go-github-com-burntsushi-toml
797 go-github-com-mattn-go-isatty
798 go-golang-org-x-mod
799 which))
800 (home-page "https://direnv.net/")
801 (synopsis "Environment switcher for the shell")
802 (description
803 "direnv can hook into the bash, zsh, tcsh, and fish shells to load
804or unload environment variables depending on the current directory. This
805allows project-specific environment variables without using @file{~/.profile}.
806
807Before each prompt, direnv checks for the existence of a @file{.envrc} file in
808the current and parent directories. This file is then used to alter the
809environment variables of the current shell.")
810 (license license:expat)))
811
812(define-public fzy
813 (package
814 (name "fzy")
815 (version "1.0")
816 (source
817 (origin
818 (method git-fetch)
819 (uri (git-reference
820 (url "https://github.com/jhawthorn/fzy")
821 (commit version)))
822 (file-name (git-file-name name version))
823 (sha256
824 (base32
825 "1gkzdvj73f71388jvym47075l9zw61v6l8wdv2lnc0mns6dxig0k"))))
826 (build-system gnu-build-system)
827 (arguments
828 (list #:make-flags
829 #~(list (string-append "CC=" #$(cc-for-target))
830 (string-append "PREFIX=" #$output))
831 #:phases
832 #~(modify-phases %standard-phases
833 (delete 'configure))))
834 (home-page "https://github.com/jhawthorn/fzy")
835 (synopsis "Fast fuzzy text selector for the terminal with an advanced
836scoring algorithm")
837 (description
838 "Most other fuzzy matchers sort based on the length of a match. fzy tries
839to find the result the user intended. It does this by favouring matches on
840consecutive letters and starts of words. This allows matching using acronyms
841or different parts of the path.
842
843fzy is designed to be used both as an editor plugin and on the command
844line. Rather than clearing the screen, fzy displays its interface directly
845below the current cursor position, scrolling the screen if necessary.")
846 (license license:expat)))
847
848(define-public hstr
849 (package
850 (name "hstr")
851 (version "3.1")
852 (source (origin
853 (method git-fetch)
854 (uri (git-reference
855 (url "https://github.com/dvorka/hstr")
856 (commit version)))
857 (file-name (git-file-name name version))
858 (sha256
859 (base32
860 "1w1xr0ddf34i46b8wwz2snf7ap6m0mv53zid3d1l5hc4m3az5qis"))))
861 (build-system gnu-build-system)
862 (arguments
863 `(#:phases
864 (modify-phases %standard-phases
865 (add-before 'build 'adjust-ncurses-includes
866 (lambda* (#:key make-flags outputs #:allow-other-keys)
867 (let ((out (assoc-ref outputs "out")))
868 (substitute* "src/include/hstr_curses.h"
869 (("ncursesw\\/curses.h") "ncurses.h"))
870 (substitute* "src/include/hstr.h"
871 (("ncursesw\\/curses.h") "ncurses.h")))
872 #t)))))
873 (native-inputs
874 (list autoconf automake pkg-config))
875 (inputs
876 (list ncurses readline))
877 (synopsis "Navigate and search command history with shell history suggest box")
878 (description "HSTR (HiSToRy) is a command-line utility that brings
879improved Bash and Zsh command completion from the history. It aims to make
880completion easier and more efficient than with @kbd{Ctrl-R}. It allows you to
881easily view, navigate, and search your command history with suggestion boxes.
882HSTR can also manage your command history (for instance you can remove
883commands that are obsolete or contain a piece of sensitive information) or
884bookmark your favourite commands.")
885 (home-page "https://me.mindforger.com/projects/hh.html")
886 (license license:asl2.0)))
887
888(define-public shell-functools
889 ;; v0.3.0 was released in 2018, there are changes providing fixes to the
890 ;; test suite, use the latest commit.
891 (let ((commit "530e3b6f098c41869f9dc47d1a3005e12ce300c0")
892 (revision "0"))
893 (package
894 (name "shell-functools")
895 (version (git-version "0.3.0" revision commit))
896 (source (origin
897 (method git-fetch)
898 (uri (git-reference
899 (url "https://github.com/sharkdp/shell-functools")
900 (commit commit)))
901 (file-name (git-file-name name version))
902 (sha256
903 (base32
904 "0l23n5anppxds4678qnh84mykbdb7qxyjrxxjzm7kin7izfzczpa"))))
905 (build-system pyproject-build-system)
906 (native-inputs
907 (list python-pytest
908 python-hatchling))
909 (home-page "https://github.com/sharkdp/shell-functools/")
910 (synopsis "Functional programming tools for the shell")
911 (description
912 "This package provides higher order functions like map,filter, foldl,
913sort_by and take_while as simple command-line tools. Following the UNIX
914philosophy, these commands are designed to be composed via pipes. A large
915collection of functions such as basename, replace, contains or is_dir are
916provided as arguments to these commands.")
917 (license license:expat))))
918
919(define-public rig
920 (package
921 (name "rig")
922 (version "1.11")
923 (source (origin
924 (method url-fetch)
925 (uri (string-append "mirror://sourceforge/rig/rig/"
926 version "/rig-"
927 version ".tar.gz"))
928 (sha256
929 (base32
930 "1f3snysjqqlpk2kgvm5p2icrj4lsdymccmn3igkc2f60smqckgq0"))))
931 (build-system gnu-build-system)
932 (arguments `(#:make-flags
933 (list (string-append "CXX=" ,(cxx-for-target))
934 (string-append "PREFIX=" %output))
935 #:phases
936 (modify-phases %standard-phases
937 (delete 'configure)
938 (add-after 'unpack 'fix-build
939 (lambda _
940 (substitute* "rig.cc"
941 (("^#include <string>")
942 "#include <cstring>"))
943 (substitute* "Makefile"
944 (("g\\+\\+")
945 "${CXX} -O2")
946 (("install -g 0 -m 755 -o 0 -s rig \\$\\(BINDIR\\)")
947 "install -m 755 -d $(DESTDIR)$(BINDIR)\n\t\
948install -m 755 rig $(DESTDIR)$(BINDIR)/rig")
949 (("install -g 0 -m 644 -o 0 rig.6 \\$\\(MANDIR\\)/man6/rig.6")
950 "install -m 755 -d $(DESTDIR)$(MANDIR)/man6/\n\t\
951install -m 644 rig.6 $(DESTDIR)$(MANDIR)/man6/rig.6")
952 (("install -g 0 -m 755 -o 0 -d \\$\\(DATADIR\\)")
953 "install -m 755 -d $(DESTDIR)$(DATADIR)")
954 (("install -g 0 -m 644 -o 0 data/\\*.idx \\$\\(DATADIR\\)")
955 "install -m 644 data/*.idx $(DESTDIR)$(DATADIR)")))))
956 #:tests? #f))
957 (home-page "https://rig.sourceforge.net")
958 (synopsis "Random identity generator")
959 (description
960 "RIG (Random Identity Generator) generates random, yet real-looking,
961personal data. It is useful if you need to feed a name to a Web site, BBS, or
962real person, and are too lazy to think of one yourself. Also, if the Web
963site/BBS/person you are giving the information to tries to cross-check the
964city, state, zip, or area code, it will check out.")
965 (license license:gpl2+)))
966
967(define-public conflict
968 (package
969 (name "conflict")
970 (version "20221002")
971 (source (origin
972 (method url-fetch)
973 (uri (string-append
974 "https://invisible-mirror.net/archives/conflict/conflict-"
975 version ".tgz"))
976 (sha256
977 (base32
978 "1z6z61yiss9m45m3agqs92l569r55w9nsqaap56kh568mcy3y64c"))))
979 (build-system gnu-build-system)
980 (arguments
981 `(#:phases
982 (modify-phases %standard-phases
983 (add-after 'unpack 'fix-paths
984 (lambda _
985 (substitute* "run_test.sh"
986 (("PATH=\".:\\$BIN:/bin\"")
987 "PATH=\".:$BIN:$PATH\"")))))))
988 (home-page "https://invisible-island.net/conflict/conflict.html")
989 (synopsis "Displays conflicting filenames in your execution path")
990 (description
991 "@code{conflict} examines the user-specifiable list of programs, looking
992for instances in the user's path which conflict (i.e., the name appears in
993more than one point in the path).")
994 (license (license:x11-style "file://COPYING"))))
995
996(define-public renameutils
997 (package
998 (name "renameutils")
999 (version "0.12.0")
1000 (source
1001 (origin
1002 (method url-fetch)
1003 (uri (string-append "mirror://savannah/renameutils/"
1004 "renameutils-" version ".tar.gz"))
1005 (sha256
1006 (base32
1007 "18xlkr56jdyajjihcmfqlyyanzyiqqlzbhrm6695mkvw081g1lnb"))
1008 (modules '((guix build utils)))
1009 (snippet '(begin
1010 (substitute* "src/Makefile.in"
1011 (("\\(\\$bindir\\)") "$(bindir)"))
1012 #t))))
1013 (build-system gnu-build-system)
1014 (inputs
1015 (list readline))
1016 (home-page "https://www.nongnu.org/renameutils/")
1017 (synopsis "File renaming utilities")
1018 (description "The file renaming utilities (renameutils for short) are a
1019set of programs designed to make renaming of files faster and less cumbersome.
1020The file renaming utilities consists of five programs: @command{qmv},
1021@command{qcp}, @command{imv}, @command{icp}, and @command{deurlname}.")
1022 (license license:gpl3+)))
1023
1024(define-public grc
1025 (package
1026 (name "grc")
1027 (version "1.13")
1028 (source
1029 (origin
1030 (method git-fetch)
1031 (uri (git-reference
1032 (url "https://github.com/garabik/grc")
1033 (commit (string-append "v" version))))
1034 (file-name (git-file-name name version))
1035 (sha256
1036 (base32 "1h0h88h484a9796hai0wasi1xmjxxhpyxgixn6fgdyc5h69gv8nl"))))
1037 (build-system gnu-build-system)
1038 (inputs
1039 (list python))
1040 (arguments
1041 (list
1042 #:phases
1043 #~(modify-phases %standard-phases
1044 (delete 'configure)
1045 (replace 'build
1046 (lambda _
1047 (substitute* "grc"
1048 (("conffilenames = \\[.*\\]")
1049 (string-append
1050 "conffilenames = ["
1051 "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') "
1052 "+ '/etc/grc.conf']")))
1053 (substitute* "grcat"
1054 (("conffilepath \\+= \\['/usr/.*\\]")
1055 (string-append
1056 "conffilepath += ["
1057 "os.environ.get('GUIX_ENVIRONMENT', '" #$output "') "
1058 "+ '/share/grc/']"))))) ;; trailing slash!
1059 (delete 'check)
1060 (replace 'install
1061 (lambda _
1062 (invoke "sh" "install.sh" #$output #$output))))))
1063 (home-page "http://kassiopeia.juls.savba.sk/~garabik/software/grc.html")
1064 (synopsis "Generic colouriser for everything")
1065 (description "@code{grc} can be used to colourise logfiles, output of
1066shell commands, arbitrary text, etc. Many shell commands are supported out of
1067the box.
1068
1069You might want to add these lines you your @code{~/.bashrc}:
1070@example
1071GRC_ALIASES=true
1072source ${GUIX_ENVIRONMENT:-$HOME/.guix-profile}/etc/profile.d/grc.sh
1073@end example
1074")
1075 (license license:gpl2)))
1076
1077(define-public liquidprompt
1078 (package
1079 (name "liquidprompt")
1080 (version "2.1.2")
1081 (home-page "https://github.com/liquidprompt/liquidprompt")
1082 (source
1083 (origin
1084 (method git-fetch)
1085 (uri (git-reference
1086 (url "https://github.com/liquidprompt/liquidprompt")
1087 (commit (string-append "v" version))))
1088 (file-name (git-file-name name version))
1089 (sha256
1090 (base32 "0ljlq97mh84d6g6r3abb254vrwrdan5v74b69fpd62d7p9ffnsgf"))))
1091 (build-system copy-build-system)
1092 (arguments
1093 (list
1094 #:install-plan #~'(("liquidpromptrc-dist" "etc/liquidpromptrc")
1095 ("example.bashrc" "share/liquidprompt/examples/")
1096 ("liquid.ps1" "share/liquidprompt/examples/")
1097 ("liquidprompt" "share/liquidprompt/")
1098 ("contrib" "share/liquidprompt/")
1099 ("themes" "share/liquidprompt/")
1100 ("liquidprompt.plugin.zsh"
1101 "share/zsh/plugins/liquidprompt/")
1102 ("docs" #$(string-append "share/doc/" name "-"
1103 version "/")))
1104 #:phases #~(modify-phases %standard-phases
1105 (add-after 'unpack 'fix-plugin
1106 (lambda _
1107 (substitute* "liquidprompt.plugin.zsh"
1108 (("source(.*)$")
1109 (string-append "source "
1110 #$output
1111 "/share/liquidprompt/liquidprompt")))))
1112 (add-after 'fix-plugin 'fix-utils-path
1113 (lambda* (#:key inputs #:allow-other-keys)
1114 (substitute* "liquidprompt"
1115 (("([ (])\\\\?(tput|hostname|cksum|uname|tty|grep)([) ])"
1116 all beginning command ending)
1117 (string-append beginning
1118 (search-input-file
1119 inputs
1120 (string-append "bin/" command))
1121 ending))))))))
1122 (inputs (list ncurses
1123 coreutils
1124 inetutils))
1125 (synopsis "Full-featured prompt for Bash & Zsh")
1126 (description
1127 "Liquidprompt is an adaptive prompt for Bash and Zsh that gives
1128you a nicely displayed prompt with useful information when you need it. It
1129does this with a powerful theming engine and a large array of data sources.
1130
1131In order to use liquidprompt with Zsh, you should use the following snippet
1132with Guix Home:
1133
1134@example
1135(service home-zsh-service-type
1136 (home-zsh-configuration
1137 (zshrc (list ;;...
1138 ;; This loads liquidprompt
1139 (mixed-text-file \"liquidprompt\"
1140 \"[[ $- = *i* ]] && source \" liquidprompt \"/share/liquidprompt/liquidprompt\")
1141 ;; This loads the powerline theme available in liquidprompt
1142 (mixed-text-file \"powerline-theme\"
1143 \"source \" liquidprompt \"/share/liquidprompt/themes/powerline/powerline.theme\"))))))
1144@end example\n")
1145 (license license:agpl3+)))
1146
1147(define-public fzf-tab
1148 (package
1149 (name "fzf-tab")
1150 (version "1.1.2")
1151 (home-page "https://github.com/Aloxaf/fzf-tab")
1152 (source (origin
1153 (method git-fetch)
1154 (uri (git-reference
1155 (url "https://github.com/Aloxaf/fzf-tab")
1156 (commit (string-append "v" version))))
1157 (file-name (git-file-name name version))
1158 (sha256
1159 (base32
1160 "061jjpgghn8d5q2m2cd2qdjwbz38qrcarldj16xvxbid4c137zs2"))))
1161 (build-system copy-build-system)
1162 (arguments
1163 '(#:install-plan '(("lib" "/share/zsh/plugins/fzf-tab/")
1164 ("modules" "/share/zsh/plugins/fzf-tab/")
1165 ("fzf-tab.plugin.zsh" "/share/zsh/plugins/fzf-tab/")
1166 ("fzf-tab.zsh" "/share/zsh/plugins/fzf-tab/")
1167 ("README.md" "/share/doc/fzf-tab/"))))
1168 (synopsis "Replace the zsh default completion menu with fzf")
1169 (description
1170 "The fzf-tab package replaces the default completion menu of the zsh
1171shell with fzf, enabling fuzzy finding and multi-selection.")
1172 (license license:expat)))
1173
1174(define-public pay-respects
1175 (package
1176 (name "pay-respects")
1177 (version "0.7.9")
1178 (source
1179 (origin
1180 (method url-fetch)
1181 (uri (crate-uri "pay-respects" version))
1182 (file-name (string-append name "-" version ".tar.gz"))
1183 (sha256
1184 (base32 "0inwxkcqavzx30c3kgc6rjrahdavwfqdwaq2q1ccncivl1j0fjln"))))
1185 (build-system cargo-build-system)
1186 (arguments (list #:install-source? #f))
1187 (inputs (cargo-inputs 'pay-respects))
1188 (home-page "https://codeberg.org/iff/pay-respects")
1189 (synopsis "Suggest correction for mistyped console commands")
1190 (description
1191 "@command{pay-respects} provides a shell helper to suggest correction for
1192mistyped commands, with @command{guix locate} integration and an alias (default
1193to @command{f}) to correct the previous command.")
1194 (license license:agpl3+)))