forked from hdoc/hdoc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
47 lines (41 loc) · 1.3 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
{
description = "hdoc";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in rec {
buildTimeDeps = with pkgs; [ xxd meson cmake ninja pkg-config ];
gitrev =
if (self ? rev) then builtins.substring 0 7 self.rev else "dirty";
packages.hdoc = with pkgs;
stdenv.mkDerivation {
name = "hdoc";
src = self;
nativeBuildInputs = buildTimeDeps;
buildInputs = [
openssl
llvmPackages_14.clang-unwrapped
llvmPackages_14.llvm
llvmPackages_14.libclang
];
CPPFLAGS = ''-DHDOC_GIT_REV=\"${gitrev}\"'';
installPhase = ''
mkdir -p $out/bin;
install -t $out/bin hdoc;
install -t $out/bin hdoc-online;
'';
};
defaultPackage = packages.hdoc;
devShell = with pkgs;
mkShell {
buildInputs = buildTimeDeps ++ [
zola
openssl
llvmPackages_14.clang-unwrapped
llvmPackages_14.llvm
llvmPackages_14.libclang
];
};
});
}