pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / servers / traefik / default.nix
blobdb5c231b45de670249f9a2c930fde7be90c2c06d
1 { lib, fetchzip, buildGo123Module, nixosTests }:
3 buildGo123Module rec {
4   pname = "traefik";
5   version = "3.1.4";
7   # Archive with static assets for webui
8   src = fetchzip {
9     url = "https://github.com/traefik/traefik/releases/download/v${version}/traefik-v${version}.src.tar.gz";
10     hash = "sha256-e77PCMeN6Ck6hQ3Rx7MU4EL+f/1kpA2E+gVcISoUnf4=";
11     stripRoot = false;
12   };
14   vendorHash = "sha256-iYwA/y9AuHomyEckOyl4845lkQkeBAFDsGiZWESylqs=";
16   subPackages = [ "cmd/traefik" ];
18   preBuild = ''
19     GOOS= GOARCH= CGO_ENABLED=0 go generate
21     CODENAME=$(grep -Po "CODENAME \?=\s\K.+$" Makefile)
23     ldflags="-s"
24     ldflags+=" -w"
25     ldflags+=" -X github.com/traefik/traefik/v${lib.versions.major version}/pkg/version.Version=${version}"
26     ldflags+=" -X github.com/traefik/traefik/v${lib.versions.major version}/pkg/version.Codename=$CODENAME"
27   '';
29   doCheck = false;
31   passthru.tests = { inherit (nixosTests) traefik; };
33   meta = with lib; {
34     homepage = "https://traefik.io";
35     description = "Modern reverse proxy";
36     changelog = "https://github.com/traefik/traefik/raw/v${version}/CHANGELOG.md";
37     license = licenses.mit;
38     maintainers = with maintainers; [ vdemeester ];
39     mainProgram = "traefik";
40   };