kube3d: build as GoModule instead of GoPackage (#70062)

Also adds build flags version and k3sVersion. Previously it was using the default, dev and latest
This commit is contained in:
José Luis Lafuente 2019-09-30 23:37:37 +02:00 committed by Wael Nasreddine
parent 140c30159f
commit b2c12abb28
2 changed files with 12 additions and 178 deletions

View file

@ -1,8 +1,9 @@
{ stdenv, buildGoPackage, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub }:
buildGoPackage rec {
buildGoModule rec {
pname = "kube3d";
version = "1.3.1";
k3sVersion = "0.9.1";
goPackagePath = "github.com/rancher/k3d";
@ -13,13 +14,20 @@ buildGoPackage rec {
sha256 = "0bdpjnzyxd6mdc1qv0ml89qds6305kn3wmyci2kv6g2y7r7wxvm2";
};
goDeps = ./deps.nix;
buildFlagsArray = ''
-ldflags=
-w -s
-X github.com/rancher/k3d/version.Version=${version}
-X github.com/rancher/k3d/version.K3sVersion=v${k3sVersion}
'';
modSha256 = "1qadf3gc2626l4jpad4lzi649nh8if9m6fgs2cf46r1nish16h95";
meta = with stdenv.lib; {
homepage = "https://github.com/rancher/k3d";
description = "A helper to run k3s (Lightweight Kubernetes. 5 less than k8s) in a docker container";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ kuznero ];
maintainers = with maintainers; [ kuznero jlesquembre ];
};
}

View file

@ -1,174 +0,0 @@
# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix)
[
{
goPackagePath = "github.com/Microsoft/go-winio";
fetch = {
type = "git";
url = "https://github.com/Microsoft/go-winio";
rev = "v0.4.12";
sha256 = "10v2f1xaw2cc97mjqnxzgs9ydpqv71f0ynp1spcywqw97la56zqw";
};
}
{
goPackagePath = "github.com/davecgh/go-spew";
fetch = {
type = "git";
url = "https://github.com/davecgh/go-spew";
rev = "v1.1.0";
sha256 = "0d4jfmak5p6lb7n2r6yvf5p1zcw0l8j74kn55ghvr7zr7b7axm6c";
};
}
{
goPackagePath = "github.com/docker/distribution";
fetch = {
type = "git";
url = "https://github.com/docker/distribution";
rev = "v2.7.1";
sha256 = "1nx8b5a68rn81alp8wkkw6qd5v32mgf0fk23mxm60zdf63qk1nzw";
};
}
{
goPackagePath = "github.com/docker/docker";
fetch = {
type = "git";
url = "https://github.com/docker/docker";
rev = "v1.13.1";
sha256 = "0l9kjibnpwcgk844sibxk9ppyqniw9r0np1mzp95f8f461jb0iar";
};
}
{
goPackagePath = "github.com/docker/go-connections";
fetch = {
type = "git";
url = "https://github.com/docker/go-connections";
rev = "v0.4.0";
sha256 = "0mv6f6b5nljc17dmwmc28hc0y11pqglz7x0d2mjrwdmfxf64hwqq";
};
}
{
goPackagePath = "github.com/docker/go-units";
fetch = {
type = "git";
url = "https://github.com/docker/go-units";
rev = "v0.3.3";
sha256 = "0npxsb3pp89slwf4a73fxm20hykad8xggij6i6hcd5jy19bjrd93";
};
}
{
goPackagePath = "github.com/mattn/go-runewidth";
fetch = {
type = "git";
url = "https://github.com/mattn/go-runewidth";
rev = "v0.0.4";
sha256 = "00b3ssm7wiqln3k54z2wcnxr3k3c7m1ybyhb9h8ixzbzspld0qzs";
};
}
{
goPackagePath = "github.com/mitchellh/go-homedir";
fetch = {
type = "git";
url = "https://github.com/mitchellh/go-homedir";
rev = "v1.1.0";
sha256 = "0ydzkipf28hwj2bfxqmwlww47khyk6d152xax4bnyh60f4lq3nx1";
};
}
{
goPackagePath = "github.com/olekukonko/tablewriter";
fetch = {
type = "git";
url = "https://github.com/olekukonko/tablewriter";
rev = "v0.0.1";
sha256 = "0hh95glg7d2md185r03wn52j2r33jc4zil0qvcrs66ka7bdxi7vj";
};
}
{
goPackagePath = "github.com/opencontainers/go-digest";
fetch = {
type = "git";
url = "https://github.com/opencontainers/go-digest";
rev = "v1.0.0-rc1";
sha256 = "01gc7fpn8ax429024p2fcx3yb18axwz5bjf2hqxlii1jbsgw4bh9";
};
}
{
goPackagePath = "github.com/pkg/errors";
fetch = {
type = "git";
url = "https://github.com/pkg/errors";
rev = "v0.8.1";
sha256 = "0g5qcb4d4fd96midz0zdk8b9kz8xkzwfa8kr1cliqbg8sxsy5vd1";
};
}
{
goPackagePath = "github.com/pmezard/go-difflib";
fetch = {
type = "git";
url = "https://github.com/pmezard/go-difflib";
rev = "v1.0.0";
sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw";
};
}
{
goPackagePath = "github.com/stretchr/objx";
fetch = {
type = "git";
url = "https://github.com/stretchr/objx";
rev = "v0.1.0";
sha256 = "19ynspzjdynbi85xw06mh8ad5j0qa1vryvxjgvbnyrr8rbm4vd8w";
};
}
{
goPackagePath = "github.com/stretchr/testify";
fetch = {
type = "git";
url = "https://github.com/stretchr/testify";
rev = "v1.3.0";
sha256 = "0wjchp2c8xbgcbbq32w3kvblk6q6yn533g78nxl6iskq6y95lxsy";
};
}
{
goPackagePath = "github.com/urfave/cli";
fetch = {
type = "git";
url = "https://github.com/urfave/cli";
rev = "v1.20.0";
sha256 = "0y6f4sbzkiiwrxbl15biivj8c7qwxnvm3zl2dd3mw4wzg4x10ygj";
};
}
{
goPackagePath = "golang.org/x/crypto";
fetch = {
type = "git";
url = "https://go.googlesource.com/crypto";
rev = "c2843e01d9a2";
sha256 = "01xgxbj5r79nmisdvpq48zfy8pzaaj90bn6ngd4nf33j9ar1dp8r";
};
}
{
goPackagePath = "golang.org/x/net";
fetch = {
type = "git";
url = "https://go.googlesource.com/net";
rev = "b630fd6fe46b";
sha256 = "0m84kwckmmc0z05kjb4dd43g1g61al32a4z593flpcbaqx8di5sd";
};
}
{
goPackagePath = "golang.org/x/sys";
fetch = {
type = "git";
url = "https://go.googlesource.com/sys";
rev = "d0b11bdaac8a";
sha256 = "18yfsmw622l7gc5sqriv5qmck6903vvhivpzp8i3xfy3z33dybdl";
};
}
{
goPackagePath = "golang.org/x/text";
fetch = {
type = "git";
url = "https://go.googlesource.com/text";
rev = "v0.3.0";
sha256 = "0r6x6zjzhr8ksqlpiwm5gdd7s209kwk5p4lw54xjvz10cs3qlq19";
};
}
]