nixpkgs/pkgs/servers/traefik/default.nix
2020-09-10 10:05:51 +02:00

41 lines
1019 B
Nix

{ stdenv, buildGoModule, fetchFromGitHub, go-bindata, nixosTests }:
buildGoModule rec {
pname = "traefik";
version = "2.2.11";
src = fetchFromGitHub {
owner = "containous";
repo = "traefik";
rev = "v${version}";
sha256 = "0l93qb0kjbm5gjba0bxfyb5a0n1p54n5crhcsyzgrki4x586lan0";
};
vendorSha256 = "06x2mcyp6c1jdf5wz51prhcn071d0580322lcv3x2bxk2grx08i2";
doCheck = false;
subPackages = [ "cmd/traefik" ];
nativeBuildInputs = [ go-bindata ];
passthru.tests = { inherit (nixosTests) traefik; };
preBuild = ''
go generate
CODENAME=$(awk -F "=" '/CODENAME=/ { print $2}' script/binary)
buildFlagsArray+=("-ldflags=\
-X github.com/containous/traefik/v2/pkg/version.Version=${version} \
-X github.com/containous/traefik/v2/pkg/version.Codename=$CODENAME")
'';
meta = with stdenv.lib; {
homepage = "https://traefik.io";
description = "A modern reverse proxy";
license = licenses.mit;
maintainers = with maintainers; [ vdemeester ];
};
}