argo: build staticfiles with buildGoModule

+17 -4
+14 -4
pkgs/applications/networking/cluster/argo/default.nix
··· 12 12 # We build the CLI without the static server for simplicity, but the tool is still required for 13 13 # compilation to succeed. 14 14 # See: https://github.com/argoproj/argo/blob/d7690e32faf2ac5842468831daf1443283703c25/Makefile#L117 15 - staticfiles = pkgsBuildBuild.buildGoPackage rec { 15 + staticfiles = pkgsBuildBuild.buildGoModule rec { 16 16 name = "staticfiles"; 17 + 17 18 src = fetchFromGitHub { 18 19 owner = "bouk"; 19 20 repo = "staticfiles"; 20 21 rev = "827d7f6389cd410d0aa3f3d472a4838557bf53dd"; 21 - sha256 = "0xarhmsqypl8036w96ssdzjv3k098p2d4mkmw5f6hkp1m3j67j61"; 22 + hash = "sha256-wchj5KjhTmhc4XVW0sRFCcyx5W9am8TNAIhej3WFWXU="; 22 23 }; 23 24 24 - goPackagePath = "bou.ke/staticfiles"; 25 + vendorHash = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo="; 26 + 27 + excludedPackages = [ "./example" ]; 28 + 29 + preBuild = '' 30 + cp ${./staticfiles.go.mod} go.mod 31 + ''; 32 + 33 + ldflags = [ "-s" "-w" ]; 25 34 }; 26 35 in 27 36 buildGoModule rec { ··· 55 64 ''; 56 65 57 66 ldflags = [ 58 - "-s" "-w" 67 + "-s" 68 + "-w" 59 69 "-X github.com/argoproj/argo-workflows/v3.buildDate=unknown" 60 70 "-X github.com/argoproj/argo-workflows/v3.gitCommit=${src.rev}" 61 71 "-X github.com/argoproj/argo-workflows/v3.gitTag=${src.rev}"
+3
pkgs/applications/networking/cluster/argo/staticfiles.go.mod
··· 1 + module bou.ke/staticfiles 2 + 3 + go 1.18