2024-09-26 11:04:55 +00:00
|
|
|
{ lib, fetchzip, buildGo123Module, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildGo123Module rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "traefik";
|
2024-09-26 11:04:55 +00:00
|
|
|
version = "3.1.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
# Archive with static assets for webui
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/traefik/traefik/releases/download/v${version}/traefik-v${version}.src.tar.gz";
|
2024-09-26 11:04:55 +00:00
|
|
|
hash = "sha256-e77PCMeN6Ck6hQ3Rx7MU4EL+f/1kpA2E+gVcISoUnf4=";
|
2022-07-14 12:49:19 +00:00
|
|
|
stripRoot = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
vendorHash = "sha256-iYwA/y9AuHomyEckOyl4845lkQkeBAFDsGiZWESylqs=";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
subPackages = [ "cmd/traefik" ];
|
|
|
|
|
|
|
|
preBuild = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
GOOS= GOARCH= CGO_ENABLED=0 go generate
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
CODENAME=$(grep -Po "CODENAME \?=\s\K.+$" Makefile)
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
ldflags="-s"
|
|
|
|
ldflags+=" -w"
|
|
|
|
ldflags+=" -X github.com/traefik/traefik/v${lib.versions.major version}/pkg/version.Version=${version}"
|
|
|
|
ldflags+=" -X github.com/traefik/traefik/v${lib.versions.major version}/pkg/version.Codename=$CODENAME"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
passthru.tests = { inherit (nixosTests) traefik; };
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://traefik.io";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Modern reverse proxy";
|
2021-09-18 10:52:07 +00:00
|
|
|
changelog = "https://github.com/traefik/traefik/raw/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ vdemeester ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "traefik";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|