gomod2nix/default.nix
yihuang 9a26cc68c0 Lower the prerequisite of gomod2nix
`go_1_18` is only available in nixpkgs master, but `go_1_17` is available in stable `release-21.11`.
2022-05-30 16:40:20 +08:00

23 lines
524 B
Nix

{ buildGoApplication, go, nix, lib, makeWrapper, nix-prefetch-git }:
buildGoApplication {
inherit go;
pname = "gomod2nix";
version = "0.1";
src = lib.cleanSourceWith {
filter = name: type: ! lib.hasSuffix "tests" name;
src = lib.cleanSource ./.;
};
modules = ./gomod2nix.toml;
allowGoReference = true;
subPackages = [ "." ];
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/gomod2nix --prefix PATH : ${lib.makeBinPath [ go ]}
rm -f $out/bin/builder
'';
}