-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
41 lines (34 loc) · 981 Bytes
/
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
{
description = "Flake for building Iotmonitor";
# inputs = [ zig git cmake leveldb pandoc ];
inputs = {
nixpkgs.url = "https://github.com/NixOS/nixpkgs/archive/22.05.tar.gz";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in {
packages.iotmonitor =
# Notice the reference to nixpkgs here.
pkgs.stdenv.mkDerivation {
name = "iotmonitor";
src = self;
buildInputs = [ pkgs.zig pkgs.git pkgs.cmake pkgs.leveldb pkgs.pandoc ];
configurePhase = ''
ls
zig version
'';
buildPhase = ''
make
zig build
'';
installPhase = ''
mkdir -p $out/bin
mv bin/iotmonitor $out/bin
'';
};
defaultPackage = self.packages.${system}.iotmonitor;
}
);
}