forked from akvorado/akvorado
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
42 lines (41 loc) · 1.13 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
{
inputs = {
nixpkgs.url = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
deps = [
pkgs.curl
pkgs.git
pkgs.go_1_19
pkgs.nodejs-16_x
pkgs.protobuf
];
in
{
# This can be built with "nix build --option sandbox false".
# Not a good example on how to package things for Nix!
packages.default = pkgs.stdenv.mkDerivation {
name = "akvorado";
src = ./.;
nativeBuildInputs = deps;
configurePhase = ''
export HOME=$TMPDIR
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
export GOFLAGS=-trimpath
'';
installPhase = ''
mkdir -p $out/bin
cp bin/akvorado $out/bin/.
'';
};
# Activate with "nix develop"
devShells.default = pkgs.mkShell {
name = "akvorado-dev";
buildInputs = deps;
};
});
}