go2nix
provides an autmatic way to create Nix derivations for Go applications.
- Start with app sources than can be built on your machine with
go build
. It means that you need to get all dependencies into currentGOPATH
. - Run
go2nix save
in application source dir wheremain
package lives. This will create 2 filesdefault.nix
anddeps.nix
that can be moved into its own directory undernixpkgs
.
stay tuned
The preferred way of installing go2nix
is to use nix
like nix-env -i go2nix
or using it declaratively.
But you can also use go get github.com/kamilchm/go2nix
.