-
Notifications
You must be signed in to change notification settings - Fork 11
/
flake.nix
49 lines (47 loc) · 1.74 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
{
description = "Chainweb Mining Client";
inputs = {
hs-nix-infra.url = "github:kadena-io/hs-nix-infra";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, hs-nix-infra, flake-utils, }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (hs-nix-infra) nixpkgs haskellNix;
overlays = [ haskellNix.overlay
(final: prev: {
# This overlay adds our project to pkgs
chainweb-mining-client =
final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc8107";
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
shell.tools = {
cabal = {};
hlint = {};
haskell-language-server = {};
};
# Non-Haskell shell tools go here
shell.buildInputs = with pkgs; [
nixpkgs-fmt
];
# This adds `js-unknown-ghcjs-cabal` to the shell.
# shell.crossPlatforms = p: [p.ghcjs];
};
})
];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
project = pkgs.chainweb-mining-client;
flake = project.flake {};
in {
# Built by `nix build .`
packages.default = flake.packages."chainweb-mining-client:exe:chainweb-mining-client";
packages.recursive = with hs-nix-infra.lib.recursive system;
wrapRecursiveWithMeta "chainweb-mining-client" "${wrapFlake self}.default";
devShell = flake.devShell;
# Other flake outputs provided by haskellNix can be accessed through
# this project output
inherit project;
});
}