projects/guix·blob rust-team · refs

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