-
Notifications
You must be signed in to change notification settings - Fork 9
/
flake.nix
65 lines (57 loc) · 1.86 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
{
description = "High performance Monte Carlo simulator";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/master;
flake-compat = {
url = github:edolstra/flake-compat;
flake = false;
};
mini-compile-commands = {
url = github:danielbarter/mini_compile_commands;
flake = false;
};
};
outputs = { self, nixpkgs, flake-compat, mini-compile-commands }:
# RNMC is so simple that the build derivation looks exactly the same on
# all platforms.
let genericDefaultPackage = systemString:
with import nixpkgs { system = systemString; };
gccStdenv.mkDerivation {
name = "RNMC";
src = self;
buildInputs = [
gsl
sqlite
];
buildPhase = "./build.sh";
# installPhase = "mkdir -p $out/bin; mv ./build/* $out/bin";
installPhase = "mkdir -p $out/bin; cp ./build/* $out/bin";
doCheck = true;
checkPhase = "tests/test.sh";
};
in {
devShell.x86_64-linux =
with import nixpkgs { system = "x86_64-linux"; };
# (mkShell.override { stdenv = (callPackage mini-compile-commands {}).wrap clangStdenv; }) {
(mkShell.override { stdenv = gccStdenv; }) {
buildInputs = [
gcc
gnumake
glibc
gsl
(sqlite.override { interactive = true; })
sqlitebrowser
gdb
valgrind
];
};
defaultPackage = {
x86_64-linux = genericDefaultPackage "x86_64-linux";
x86_64-darwin = genericDefaultPackage "x86_64-darwin";
};
checks = {
x86_64-linux.tests = genericDefaultPackage "x86_64-linux";
x86_64-darwin.tests = genericDefaultPackage "x86_64-darwin";
};
};
}