-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
79 lines (75 loc) · 2.57 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
# Nix flake based on Cardano base
# https://github.com/input-output-hk/cardano-base/blob/master/flake.nix
{
inputs = {
haskellNix.url = "github:input-output-hk/haskell.nix";
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
iohkNix.url = "github:input-output-hk/iohk-nix";
flake-utils.url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs";
hls = {
url = "github:cardano-scaling/haskell-language-server?ref=2.6-patched";
flake = false;
};
};
outputs = inputs:
let
profiling = false;
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
# not supported on ci.iog.io right now
#"aarch64-linux"
"aarch64-darwin"
]; in
inputs.flake-utils.lib.eachSystem supportedSystems (system:
let
# setup our nixpkgs with the haskell.nix overlays, and the iohk-nix
# overlays...
nixpkgs = import inputs.nixpkgs {
overlays = [inputs.haskellNix.overlay] ++ builtins.attrValues inputs.iohkNix.overlays;
inherit system;
inherit (inputs.haskellNix) config;
};
# ... and construct a flake from the cabal.project file.
# We use cabalProject' to ensure we don't build the plan for
# all systems.
flake = (nixpkgs.haskell-nix.cabalProject' rec {
src = ./.;
name = "fine-type";
compiler-nix-name = "ghc964";
# tools we want in our shell
shell.tools = {
cabal = "3.10.1.0";
fourmolu = "0.13.1.0";
};
# Now we use pkgsBuildBuild, to make sure that even in the cross
# compilation setting, we don't run into issues where we pick tools
# for the target.
shell.buildInputs = with nixpkgs.pkgsBuildBuild; [
just
gitAndTools.git
haskellPackages.ghcid
haskellPackages.hlint
(haskell-nix.tool "ghc964" "haskell-language-server" ({pkgs, ...}: rec {
# Use the github source of HLS that is tested with haskell.nix CI
src = inputs.hls;
}))
];
shell.withHoogle = true;
}).flake (
# we also want cross compilation to windows.
nixpkgs.lib.optionalAttrs (system == "x86_64-linux") {
crossPlatforms = p: [p.mingwW64];
});
in flake
);
nixConfig = {
extra-substituters = [
"https://cache.iog.io"
];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
];
allow-import-from-derivation = true;
};
}