diff options
-rw-r--r-- | pkgs/servers/traefik/default.nix | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/pkgs/servers/traefik/default.nix b/pkgs/servers/traefik/default.nix index d2a784cdf1317..cb3f01d77ee2b 100644 --- a/pkgs/servers/traefik/default.nix +++ b/pkgs/servers/traefik/default.nix @@ -1,39 +1,35 @@ -{ stdenv, buildGoPackage, fetchFromGitHub, bash, go-bindata}: +{ stdenv, buildGoModule, fetchFromGitHub, go-bindata }: -buildGoPackage rec { +buildGoModule rec { pname = "traefik"; - version = "1.7.14"; - - goPackagePath = "github.com/containous/traefik"; + version = "2.2.0"; src = fetchFromGitHub { owner = "containous"; repo = "traefik"; rev = "v${version}"; - sha256 = "1j3p09j8rpdkp8v4d4mz224ddakkvhzchvccm9qryrqc2fq4022v"; + sha256 = "1dcazssabqxr9wv3dds3z7ks3y628qa07vgnn3hpdwxzm2b2ma92"; }; - nativeBuildInputs = [ go-bindata bash ]; - - buildPhase = '' - runHook preBuild - ( - cd go/src/github.com/containous/traefik - bash ./script/make.sh generate - - CODENAME=$(awk -F "=" '/CODENAME=/ { print $2}' script/binary) - go build -ldflags "\ - -X github.com/containous/traefik/version.Version=${version} \ - -X github.com/containous/traefik/version.Codename=$CODENAME \ - " -a -o $bin/bin/traefik ./cmd/traefik - ) - runHook postBuild + modSha256 = "0w3ssxvsmq8i6hbfmn4ig2x13i2nlqy5q1khcblf9pq5vhk202qx"; + subPackages = [ "cmd/traefik" ]; + + nativeBuildInputs = [ go-bindata ]; + + preBuild = '' + go generate + + CODENAME=$(awk -F "=" '/CODENAME=/ { print $2}' script/binary) + + makeFlagsArray+=("-ldflags=\ + -X github.com/containous/traefik/version.Version=${version} \ + -X github.com/containous/traefik/version.Codename=$CODENAME") ''; meta = with stdenv.lib; { homepage = "https://traefik.io"; description = "A modern reverse proxy"; license = licenses.mit; - maintainers = with maintainers; [ hamhut1066 vdemeester ]; + maintainers = with maintainers; [ vdemeester ]; }; } |