-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
64 lines (51 loc) · 1.72 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
description = "Heterogeneous ranges for c++20";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, nixpkgs }:
let
allSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f system);
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlay ];
}
);
heraCfg = final: stdenv: stdenv.mkDerivation {
name = "hera";
nativeBuildInputs = [ final.cmake final.catch2 ];
buildInputs = [];
src = self;
cmakeFlags = [
"-DHERA_DOCS=OFF"
"-DHERA_EXAMPLES=OFF"
"-DHERA_TESTS=ON"
];
enableParallelBuilding = true;
doCheck = true;
checkTarget = "test";
meta = with stdenv.lib; {
description = self.description;
homepage = "https://github.com/dreyri/hera";
license = licenses.mit;
platforms = platforms.all;
};
};
in {
overlay = final: prev:
let
clang10Stdenv = final.overrideCC final.clangStdenv final.clang_10;
in {
heraClang = heraCfg final final.clangStdenv;
heraClang10 = heraCfg final clang10Stdenv;
heraGcc10 = heraCfg final final.gcc10Stdenv;
hera = heraCfg final final.gcc10Stdenv;
};
packages = forAllSystems (system: {
inherit (nixpkgsFor.${system}) hera heraGcc10 heraClang heraClang10;
});
defaultPackage = forAllSystems (system: self.packages.${system}.hera);
};
}