-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
52 lines (45 loc) · 1002 Bytes
/
default.nix
File metadata and controls
52 lines (45 loc) · 1002 Bytes
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
{
lib,
buildGoApplication,
installShellFiles,
}:
buildGoApplication (
lib.fix (finalAttrs: {
meta.mainProgram = finalAttrs.pname;
pname = "rfm";
version = lib.fileContents ./version.txt;
src =
with lib.fileset;
toSource {
root = ./.;
fileset = unions [
# code
./bpf
./cmd
./collector
./config
./enrich
./export
./probe
./testutil
# meta
./go.mod
./go.sum
./gomod2nix.toml
./version.txt
];
};
modules = ./gomod2nix.toml;
subPackages = [ "cmd/rfm" ];
ldflags = [
"-X"
"main.version=${finalAttrs.version}"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
for shell in bash zsh fish; do
installShellCompletion --cmd ${finalAttrs.pname} --''${shell} <("$out/bin/${finalAttrs.pname}" completion "$shell")
done
'';
})
)