Wordsmith

Notes on Making a Writefreely Package for Guix

Okay. I've installed Guix on my system, I've installed Writefreely. It's time to try and write a package.

I'm using this tutorial, mostly: https://www.gnu.org/software/guix/blog/2018/a-packaging-tutorial-for-guix/

And here's what I have so far:

    (define-module (writefreely)
      #:use-module (guix packages)
      #:use-module (guix download)
      #:use-module (guix build-system gnu)
      #:use-module (guix licenses)
      #:use-module (guix git-download))
    
    (define-public writefreely
      (package
       (name "writefreely")
       (version "0.9.1")
       (source (origin
    	    (method git-fetch)
    	    (uri (git-reference
    		  (url "https://github.com/writeas/writefreely/")
    		  (commit "fdbefa806fd05ea5f61cf1a0fc75900c2a1dd24e")))
    	    (sha256
    	     (base32
    	      "0zp9d6n1mp0nfcpfxl3pyjy235q386h84skz97yhd348zjnmq7ki"))))
       (native-inputs `(("go" ,go)
    		    ("node" ,node)))
       (build-system gnu-build-system)
       (arguments
        `(#:phases (modify-phases %standard-phases (delete 'configure))))
       (synopsis "A simple, federated blogging platform.")
       (description "WriteFreely is a blogging platform that can publish to
    the 'Fediverse' via ActivityPub.")
       (home-page "https://writefreely.org/")
       (license agpl3)))

It has writefreely on the line by itself at the end, so I can do guix package --install-from-file=writefreely.scm.

But that errors, saying that go is an unbound variable. Makes sense, I don't define it. I think I need to do that by adding another #:use-module line, but I don't know the name of the go… module?

Oh. It's golang. So I've added this to the first bit of that package definition:

    #:use-module (gnu packages golang)
    #:use-module (gnu packages node)

Now, it's giving me this error when I run it:

go: disabling cache (/homeless-shelter/.cache/go-build) due to initialization failure: mkdir /homeless-shelter: permission denied

I've been looking online for a solution to this one, and it looks like maybe it's because go tries to use $HOME?

Looking further, it's because $GOPATH includes my home directory, I think.