Trying to Build my First Package on Guix

Hello.

I just downloaded Guix this weekend and have my system pretty well setup. However, I am a heretic and use neovim, but Treesitter is acting very funky on my system. In the guix repos the latest version is 0.25.3, and my nvim :checkhealth suggests having 0.26.9, so I figured hey lets package my first system.

Here is what I am trying. I am kinda guessing off of minimal documentation but I continuously get build errors.

(use-modules (guix)
             (guix packages)
             (guix download)
             (guix build-system trivial)
             (guix licenses)
             (guix utils)
             (srfi srfi-1)
             (gnu packages compression) ; provides `gzip`
             (gnu packages bash))  

(define-public tree-sitter-cli
  (package
    (name "tree-sitter-cli")
    (version "0.26.9")
    (source (origin
             (method url-fetch)
             (uri (string-append
                   "https://github.com/tree-sitter/tree-sitter/releases/download/v"
                   version
                   "/tree-sitter-linux-x64.gz"))
             (sha256
              (base32 "1ysyb312dpf4p5ql6750sadqry6fj79rz1lbrbkn8n56r8vj3s4w"))))
    (build-system trivial-build-system)
    (native-inputs `(("gzip" ,gzip)
                     ("bash" ,bash-minimal)))
    (arguments
     `(#:builder
       ,#~(lambda ()
           (let ((src (assoc-ref %build-inputs "source"))
                 (out (assoc-ref %outputs "out")))
             (invoke "mkdir" "-p" (string-append out "/bin"))
             (invoke "cp" src (string-append out "/tree-sitter.gz"))
             (invoke "bash" "-c" (string-append "gunzip -c " (string-append out "/tree-sitter.gz")
                                               " > " out "/bin/tree-sitter"))
             (invoke "chmod" "0755" (string-append out "/bin/tree-sitter"))
             0))))
    (home-page "https://github.com/tree-sitter/tree-sitter")
    (synopsis "tree-sitter-cli (prebuilt v0.26.9)")
    (description "Prebuilt tree-sitter CLI (linux x86_64) from upstream releases.")
    (license expat)))

tree-sitter-cli

I’m not quite sure I know what I am doing, so any helpful learnings is much appreciated! I am very new to Guile and Lisps in general, but am excited to learn!

The errors are pretty unhelpful and the logs in /var/log are empty:

building /gnu/store/l1ja76imb5mv17zz2wianifa0wz22sp4-tree-sitter-cli-0.26.9.drv...
builder for `/gnu/store/l1ja76imb5mv17zz2wianifa0wz22sp4-tree-sitter-cli-0.26.9.drv' failed to produce output path `/gnu/store/gc67ypxi72vldm90zsipkx33139akc2g-tree-sitter-cli-0.26.9'
build of /gnu/store/l1ja76imb5mv17zz2wianifa0wz22sp4-tree-sitter-cli-0.26.9.drv failed
View build log at '/var/log/guix/drvs/l1/ja76imb5mv17zz2wianifa0wz22sp4-tree-sitter-cli-0.26.9.drv.gz'.
cannot build derivation `/gnu/store/0cr164z2vfkyw2xc01cjh1p93dpqj958-profile.drv': 1 dependencies couldn't be built

Welcome! I’m a fellow neovim heretic and used this guide to setup my installation.

I’ve only made one other basic package definition myself, so I’m no means an expert.

Another neovim heretic here.

I use rocks.nvim to install my vim plugins.
Though I haven’t actually used any of them yet on this system, it worked like a charm on my previous OS.