-
Notifications
You must be signed in to change notification settings - Fork 28
/
flake.nix
85 lines (75 loc) · 2.79 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
description = "Operon development environment";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:nixos/nixpkgs/master";
foolnotion.url = "github:foolnotion/nur-pkg";
lbfgs.url = "github:foolnotion/lbfgs";
pratt-parser.url = "github:foolnotion/pratt-parser-calculator";
vstat.url = "github:heal-research/vstat";
vdt.url = "github:foolnotion/vdt/master";
# make everything follow nixpkgs
foolnotion.inputs.nixpkgs.follows = "nixpkgs";
lbfgs.inputs.nixpkgs.follows = "nixpkgs";
pratt-parser.inputs.nixpkgs.follows = "nixpkgs";
vstat.inputs.nixpkgs.follows = "nixpkgs";
vdt.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, flake-parts, nixpkgs, foolnotion, pratt-parser, vdt, vstat, lbfgs }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
perSystem = { pkgs, system, ... }:
let
pkgs = import self.inputs.nixpkgs {
inherit system;
overlays = [
foolnotion.overlay
(final: prev: {
vdt = vdt.packages.${system}.default;
vstat = vstat.packages.${system}.default;
lbfgs = lbfgs.packages.${system}.default;
pratt-parser = pratt-parser.packages.${system}.default;
})
];
};
stdenv = pkgs.llvmPackages_19.stdenv;
#stdenv = pkgs.gcc12Stdenv;
operon = import ./operon.nix { inherit stdenv pkgs system; };
in
rec
{
packages = {
default = operon.overrideAttrs (old: {
cmakeFlags = old.cmakeFlags ++ [ "-DBUILD_CLI_PROGRAMS=ON" "-DCPM_USE_LOCAL_PACKAGES=ON" ];
});
library = operon.overrideAttrs (old: {
enableShared = true;
});
library-static = operon.overrideAttrs (old: {
enableShared = false;
});
};
devShells.default = stdenv.mkDerivation {
name = "operon";
nativeBuildInputs = operon.nativeBuildInputs ++ (with pkgs; [
clang-tools_19
cppcheck
include-what-you-use
cmake-language-server
]);
buildInputs = operon.buildInputs ++ (with pkgs; [
gdb
graphviz
hyperfine
linuxPackages_latest.perf
seer
valgrind
hotspot
]);
};
apps.operon-gp.program = "${packages.default}/bin/operon_gp";
apps.operon-nsgp.program = "${packages.default}/bin/operon_nsgp";
apps.operon-parse-model.program = "${packages.default}/bin/operon_parse_model";
};
};
}