1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00
nixpkgs/pkgs/servers/traefik/default.nix
Benno Fünfstück f7e5bb0231 traefik: fix dashboard by using source releases
The traefik dashboard depends on static files built with npm.
The source releases included the prebundled static files ,
so switching to them fixes the issue.
2020-09-27 10:41:44 +02:00

45 lines
1.1 KiB
Nix

{ stdenv, fetchurl, buildGoModule, go-bindata, nixosTests }:
buildGoModule rec {
pname = "traefik";
version = "2.2.11";
src = fetchurl {
url = "https://github.com/containous/traefik/releases/download/v${version}/traefik-v${version}.src.tar.gz";
sha256 = "00kprbr437ml33bxm4nhxm9vwh6ywrpxvlij7p3r306bfpwa4j3r";
};
unpackPhase = ''
mkdir source
cd source
tar xf $src
'';
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 ];
};
}