-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
60 lines (59 loc) · 1.34 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
devshell = {
url = "github:numtide/devshell";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = {
self,
nixpkgs,
flake-utils,
devshell,
...
} @inputs:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
config = import ./go.nix;
overlays = [ devshell.overlays.default ];
};
in rec {
defaultPackage = pkgs.buildGoModule {
name = "tc_exporter";
src = ./.;
CGO_ENABLED = 0;
doCheck = false;
checkPhase = ''
staticcheck ./cmd/tc_exporter/
staticcheck ./collector/
go test -exec sudo ./collector/ -v
'';
vendorHash = "sha256-ZRnfVXV6/QJ98EsgTswxMeIroGfxJ2D436WzCwcVvbU";
ldflags = [
"-s" "-w"
];
};
devShells.default = pkgs.devshell.mkShell rec {
name = "tc-exporer";
packages = with pkgs; [
go_1_23
gofumpt
go-tools
git
nix
nfpm
goreleaser
gnumake
];
};
});
}