-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
88 lines (78 loc) · 2.76 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
86
87
88
{
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
outputs = { self, flake-utils, gitignore, haskellNix, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
haskellNix.overlay
(import ./nix/fix-ghc-pkgs-overlay.nix)
];
inherit (haskellNix) config;
};
src = gitignore.lib.gitignoreSource ./.;
compilerNixName = "ghc966";
flake = (pkgs.haskell-nix.hix.project {
inherit src;
evalSystem = "x86_64-linux";
compiler-nix-name = compilerNixName;
projectFileName = "stack.yaml";
modules = [
(import ./nix/fix-ghc-pkgs-module.nix)
{
packages.sauron.components.exes.sauron.configureFlags = [
''--ghc-options="-pgml g++"''
];
packages.sauron.components.exes.sauron.build-tools = [pkgs.gcc];
packages.sauron.components.exes.sauron.dontStrip = false;
}
];
}).flake {};
flakeStatic = (pkgs.pkgsCross.musl64.haskell-nix.hix.project {
inherit src;
evalSystem = "x86_64-linux";
compiler-nix-name = compilerNixName;
projectFileName = "stack.yaml";
modules = [
(import ./nix/fix-ghc-pkgs-module.nix)
{
packages.sauron.components.exes.sauron.configureFlags = [
''--ghc-options="-pgml g++"''
];
packages.sauron.components.exes.sauron.build-tools = [pkgs.gcc];
packages.sauron.components.exes.sauron.dontStrip = false;
}
];
}).flake {};
flakeWindows = (pkgs.pkgsCross.mingwW64.haskell-nix.hix.project {
inherit src;
compiler-nix-name = compilerNixName;
projectFileName = "stack.yaml";
modules = [
{
packages.bitvec.components.library.configureFlags = [
"-f -simd"
];
}
];
}).flake {};
in
{
packages = rec {
inherit pkgs flake flakeStatic;
inherit (pkgs) cabal2nix;
normal = flake.packages."sauron:exe:sauron";
static = flakeStatic.packages."sauron:exe:sauron";
windows = flakeWindows.packages."sauron:exe:sauron";
print-nixpkgs = pkgs.writeShellScriptBin "print-nixpkgs.sh" "echo ${pkgs.path}";
};
}
);
}