# nnn-ctx8.scm -rw-r--r-- 2.4 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
;; Define the Guile module containing our package.
(define-module (nnn-ctx8)
  ;; Import some other modules into our module.
  #:use-module (guix gexp) ;gexp #~, ungexp #$
  #:use-module (guix git-download) ;git-fetch and git-reference
  #:use-module (guix packages) ;package stuff, like the package/origin records
  #:use-module (guix utils) ;random utilities...

  #:use-module (gnu packages) ;for search-patches
  #:use-module (gnu packages admin) #|for the base nnn package|#)

(define-public nnn-ctx8
  (package
   ;; This is like the nnn package, but with certain overrides.
   (inherit nnn)
   (name "nnn-ctx8") ;the package name as seen by the CLI
   (version (package-version nnn)) ;the package version as seen by the CLI
   (source (origin ;an <origin> allows us to fetch sources from the internet
            (method git-fetch) ;get the source from a git repo
            (uri (git-reference ;specify the URL and commit to use
                  (url (package-home-page nnn))
                  (commit (string-append "v" version))))
            ;; locate the patch, and use it
            (patches (search-patches "no-easy-delete.patch"))
            (file-name (git-file-name name version))
            (sha256 ;used to verify the hash of the source
             (base32
              "11jc3r3mx78klgvf6rnnmm4zpx4c5nidgpkxv504rmk9fqwhlh7q"))))
   (arguments ; build-system specific arguments
    ;; We don't want to duplicate nnn's arguments, so we use
    ;; substitute-keyword-arguments to amend them.
    (substitute-keyword-arguments (package-arguments nnn)
      ;; "flags" is bound to the old value of #:make-flags.
      ((#:make-flags flags)
       ;; Add the new flag to the original flags. Here we use a `g-expression',
       ;; `#~', which starts a block of build-time code. Ungexp `#$' is the
       ;; gexp equivalent of unquote `,', allowing us to "escape" outside the
       ;; build evaluation environment.
       #~(cons* "O_CTX8=1" #$flags))))
   (description ;long-form description of the package
    "@command{nnn-ctx8-git} is @command{nnn} without the error-prone
delete on X key (^X only) and compiled with O_CTX8=1 to enable 8 contexts.

@command{nnn} is a fork of @command{noice}, a fast and minimal text terminal
file browser with keyboard shortcuts for navigation, opening files and
running tasks.  There is no configuration file and MIME associations are
hard-coded.")))