-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
64 lines (55 loc) · 1.73 KB
/
flake.nix
File metadata and controls
64 lines (55 loc) · 1.73 KB
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
61
62
63
64
{
description = "Vulnetix CLI for vulnerability management";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
version = "1.33.0";
in
{
packages = {
vulnetix = pkgs.buildGoModule {
pname = "vulnetix";
inherit version;
src = ./.;
# To update: run `nix build` — the error message will show the correct hash.
vendorHash = pkgs.lib.fakeHash;
ldflags = [
"-s"
"-w"
"-X github.com/vulnetix/cli/cmd.version=${version}"
"-X github.com/vulnetix/cli/cmd.commit=${self.shortRev or "dirty"}"
"-X github.com/vulnetix/cli/cmd.buildDate=1970-01-01T00:00:00Z"
];
postInstall = ''
mv $out/bin/cli $out/bin/vulnetix
'';
meta = with pkgs.lib; {
description = "Vulnetix CLI for vulnerability management";
homepage = "https://github.com/Vulnetix/cli";
license = licenses.mit;
mainProgram = "vulnetix";
};
};
default = self.packages.${system}.vulnetix;
};
apps = {
vulnetix = flake-utils.lib.mkApp {
drv = self.packages.${system}.vulnetix;
};
default = self.apps.${system}.vulnetix;
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
gotools
];
};
}
);
}