;;; Copyright © 2020 Collin J. Doering ;;; ;;; This file is part of the GNU Guix channel rekahsoft-guix ;;; ;;; The rekahsoft-guix channel for GNU Guix is free software; you can ;;; redistribute it and/or modify it under the terms of the GNU General Public ;;; License as published by the Free Software Foundation; either version 3 of ;;; the License, or (at your option) any later version. ;;; ;;; The rekahsoft-guix channel for GNU Guix is distributed in the hope that it ;;; will be useful, but WITHOUT ANY WARRANTY; without even the implied ;;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License along ;;; with the rekahsoft-guix channel for GNU Guix. If not, see ;;; . (define-module (rekahsoft-gnu packages shellutils) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix utils) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) #:use-module (guix build-system go) #:use-module (guix build-system python) #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages golang) #:use-module (gnu packages golang-build) #:use-module (gnu packages golang-xyz) #:use-module (gnu packages gawk) #:use-module (gnu packages ncurses) #:use-module (gnu packages pkg-config) #:use-module (gnu packages perl) #:use-module (gnu packages python) #:use-module (gnu packages readline) #:use-module (gnu packages ruby) #:use-module (gnu packages shells) #:use-module (gnu packages textutils) #:use-module (gnu packages tmux) #:use-module (rekahsoft-gnu packages golang)) ;; TODO: merge with upstream, adding missing functionality that is captured in this package (zsh keybindings) (define-public fzf (package (name "fzf") (version "0.29.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/junegunn/fzf") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "0hyxydrk057pcaqqfbbi0a4zrfxgx7688rm466a7ambl3vsrdscv")))) (build-system go-build-system) (native-inputs `(("github.com/mattn/go-isatty" ,go-github-com-mattn-go-isatty) ("github.com/mattn/go-runewidth" ,go-github-com-mattn-go-runewidth) ("github.com/mattn/go-shellwords" ,go-github-com-mattn-go-shellwords) ("go-golang-org-x-crypto" ,go-golang-org-x-crypto) ("go-golang-org-x-sys" ,go-golang-org-x-sys) ("go-github-com-saracen-walker" ,go-github-com-saracen-walker) ("go-golang.org-x-sync-errgroup" ,go-golang.org-x-sync-errgroup) ("go-github-com-rivo-uniseg" ,go-github-com-rivo-uniseg) ("go-golang-org-x-term" ,go-golang-org-x-term))) (propagated-inputs `(("tmux" ,tmux) ("perl" ,perl))) (arguments `(#:import-path "github.com/junegunn/fzf" #:install-source? #f #:phases (modify-phases %standard-phases (add-before 'build 'setup-env (lambda _ (setenv "FZF_VERSION" ,version) (setenv "FZF_REVISION" ,version))) (replace 'build (lambda _ (with-directory-excursion "src/github.com/junegunn/fzf" (invoke "make")))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (mkdir-p (string-append out "/share")) (with-directory-excursion "src/github.com/junegunn/fzf" (invoke "make" "install") (copy-recursively "bin" (string-append out "/bin")) (copy-recursively "man" (string-append out "/share/man")) (copy-recursively "shell" (string-append out "/share/fzf"))))))))) (synopsis "Command line fuzzy finder") (description "@command{fzf} is a general purpose command line fuzzy finder. It's an interactive uniz filter for command-line that can be used with any lists; files, command history, processes, hostnames, bookmarks, git commits, etc..") (home-page "https://github.com/junegunn/fzf") (license license:expat))) ;; TODO: Candidate for upstream (define-public spaceship-prompt (package (name "spaceship-prompt") (version "4.15.0") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/denysdovhan/spaceship-prompt") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 (base32 "0fndp1kvp7wayw2hmkx9j0pl3d850gcnl232fxy13r10504rj9j0")))) (build-system gnu-build-system) (propagated-inputs `(("sed" ,sed) ("gawk" ,gawk))) (arguments `(#:phases (modify-phases %standard-phases (delete 'configure) (delete 'build) (delete 'check) (replace 'install (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (func-path (string-append out "/share/zsh/site-functions")) (install-path (string-append out "/lib/spaceship-prompt"))) (for-each mkdir-p `(,func-path ,install-path)) (for-each (lambda (dir) (copy-recursively dir (string-append install-path "/" dir))) '("lib" "sections")) (for-each (lambda (f l) (copy-file f (string-append install-path "/" f)) (symlink (string-append install-path "/" f) (string-append func-path "/" l))) '("spaceship.zsh" "async.zsh") '("prompt_spaceship_setup" "async")))))))) (synopsis "Zsh prompt for Astronauts") (description "Spaceship is a minimalistic, powerful and extremely customizable Zsh prompt. It combines everything you may need for convenient work, without unecessary complications, like a real spaceship.") (home-page "https://github.com/denysdovhan/spaceship-prompt") (license license:expat)))