diff options
Diffstat (limited to 'pkgs/servers')
-rw-r--r-- | pkgs/servers/blockbook/default.nix | 15 | ||||
-rw-r--r-- | pkgs/servers/monitoring/prometheus/graphite-exporter.nix | 22 | ||||
-rw-r--r-- | pkgs/servers/monitoring/prometheus/mysqld-exporter.nix | 6 | ||||
-rw-r--r-- | pkgs/servers/traefik/default.nix | 7 | ||||
-rw-r--r-- | pkgs/servers/trickster/trickster.nix | 25 |
5 files changed, 38 insertions, 37 deletions
diff --git a/pkgs/servers/blockbook/default.nix b/pkgs/servers/blockbook/default.nix index e52b0cb00bd4d..dc9243f320246 100644 --- a/pkgs/servers/blockbook/default.nix +++ b/pkgs/servers/blockbook/default.nix @@ -41,12 +41,19 @@ buildGoModule rec { tags = [ "rocksdb_6_16" ]; + CGO_LDFLAGS = [ + "-L${stdenv.cc.cc.lib}/lib" + "-lrocksdb" + "-lz" + "-lbz2" + "-lsnappy" + "-llz4" + "-lm" + "-lstdc++" + ]; + preBuild = lib.optionalString stdenv.isDarwin '' ulimit -n 8192 - '' + '' - export CGO_LDFLAGS="-L${stdenv.cc.cc.lib}/lib -lrocksdb -lz -lbz2 -lsnappy -llz4 -lm -lstdc++" - buildFlagsArray+=("-tags=${lib.concatStringsSep " " tags}") - buildFlagsArray+=("-ldflags=${lib.concatStringsSep " " ldflags}") ''; subPackages = [ "." ]; diff --git a/pkgs/servers/monitoring/prometheus/graphite-exporter.nix b/pkgs/servers/monitoring/prometheus/graphite-exporter.nix index 819a4c3947a15..e50a984be3fe8 100644 --- a/pkgs/servers/monitoring/prometheus/graphite-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/graphite-exporter.nix @@ -13,17 +13,17 @@ buildGoModule rec { vendorHash = "sha256-he2bmcTNkuKRsNGkn1IkhtOe+Eo/5RLWLYlNFWLo/As="; - preCheck = let - skippedTests = [ - "TestBacktracking" - "TestInconsistentLabelsE2E" - "TestIssue111" - "TestIssue61" - "TestIssue90" - ]; - in '' - buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]") - ''; + checkFlags = + let + skippedTests = [ + "TestBacktracking" + "TestInconsistentLabelsE2E" + "TestIssue111" + "TestIssue61" + "TestIssue90" + ]; + in + [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; passthru.tests = { inherit (nixosTests.prometheus-exporters) graphite; }; diff --git a/pkgs/servers/monitoring/prometheus/mysqld-exporter.nix b/pkgs/servers/monitoring/prometheus/mysqld-exporter.nix index 598b3220e4a35..bfc2acad24969 100644 --- a/pkgs/servers/monitoring/prometheus/mysqld-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/mysqld-exporter.nix @@ -23,9 +23,9 @@ buildGoModule rec { ]; # skips tests with external dependencies, e.g. on mysqld - preCheck = '' - buildFlagsArray+="-short" - ''; + checkFlags = [ + "-short" + ]; meta = with lib; { description = "Prometheus exporter for MySQL server metrics"; diff --git a/pkgs/servers/traefik/default.nix b/pkgs/servers/traefik/default.nix index 77fac1c365f73..3e429e3595f73 100644 --- a/pkgs/servers/traefik/default.nix +++ b/pkgs/servers/traefik/default.nix @@ -20,9 +20,10 @@ buildGoModule rec { CODENAME=$(grep -Po "CODENAME \?=\s\K.+$" Makefile) - buildFlagsArray+=("-ldflags= -s -w \ - -X github.com/traefik/traefik/v${lib.versions.major version}/pkg/version.Version=${version} \ - -X github.com/traefik/traefik/v${lib.versions.major version}/pkg/version.Codename=$CODENAME") + 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" ''; doCheck = false; diff --git a/pkgs/servers/trickster/trickster.nix b/pkgs/servers/trickster/trickster.nix index 7b527a5c20b2d..2215990654539 100644 --- a/pkgs/servers/trickster/trickster.nix +++ b/pkgs/servers/trickster/trickster.nix @@ -1,6 +1,7 @@ { lib , buildGoModule , fetchFromGitHub +, go }: buildGoModule rec { @@ -19,22 +20,14 @@ buildGoModule rec { subPackages = [ "cmd/trickster" ]; - preBuild = - let - ldflags = with lib; - concatStringsSep " " ( - [ "-extldflags '-static'" "-s" "-w" ] ++ - (mapAttrsToList (n: v: "-X main.application${n}=${v}") { - BuildTime = "1970-01-01T00:00:00+0000"; - GitCommitID = rev; - GoVersion = "$(go env GOVERSION)"; - GoArch = "$(go env GOARCH)"; - }) - ); - in - '' - buildFlagsArray+=("-ldflags=${ldflags}") - ''; + ldflags = with lib; + [ "-extldflags '-static'" "-s" "-w" ] ++ + (mapAttrsToList (n: v: "-X main.application${n}=${v}") { + BuildTime = "1970-01-01T00:00:00+0000"; + GitCommitID = rev; + GoVersion = "go${go.version}}"; + GoArch = "${go.GOARCH}"; + }); # Tests are broken. doCheck = false; |