-
Notifications
You must be signed in to change notification settings - Fork 8
/
flake.nix
85 lines (82 loc) · 3.2 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
{
nixConfig.bash-prompt = "[nix-develop-pluto:] ";
description = "A very basic flake";
inputs = {
#CI integration
flake-compat-ci.url = "github:hercules-ci/flake-compat-ci";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
#HaskellNix is implemented using a set nixpkgs.follows; allowing for flake-build
haskellNix = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:input-output-hk/haskell.nix";
};
# Nixpkgs set to specific URL for haskellNix
nixpkgs.url = "github:NixOS/nixpkgs/baaf9459d6105c243239289e1e82e3cdd5ac4809";
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
plutus.url = "github:input-output-hk/plutus";
cardano-node.url = "github:input-output-hk/cardano-node";
plutus-apps.url = "github:input-output-hk/plutus-apps";
};
outputs = { self, nixpkgs, plutus, flake-utils, haskellNix, cardano-node, plutus-apps, flake-compat, flake-compat-ci }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
deferPluginErrors = true;
overlays = [
haskellNix.overlay
(final: prev: {
# This overlay adds our project to pkgs
pluto =
final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc8107";
projectFileName = "stack.yaml";
modules = [{
packages = {
marlowe.flags.defer-plugin-errors = deferPluginErrors;
plutus-use-cases.flags.defer-plugin-errors = deferPluginErrors;
plutus-ledger.flags.defer-plugin-errors = deferPluginErrors;
plutus-contract.flags.defer-plugin-errors = deferPluginErrors;
cardano-crypto-praos.components.library.pkgconfig =
pkgs.lib.mkForce [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ];
cardano-crypto-class.components.library.pkgconfig =
pkgs.lib.mkForce [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ];
};
}];
shell.tools = {
cabal = { };
ghcid = { };
hlint = { };
haskell-language-server = { };
stylish-haskell = { };
};
# Non-Haskell shell tools go here
shell.buildInputs = with pkgs; [
nixpkgs-fmt
];
shell.shellHook =
''
manual-ci() (
set -e
./ci/lint.sh
cabal test
nix-build
./ci/examples.sh
)
'';
};
})
];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
flake = pkgs.pluto.flake { };
in flake // {
ciNix = flake-compat-ci.lib.recurseIntoFlakeWith {
flake = self;
systems = [ "x86_64-linux" ];
};
defaultPackage = flake.packages."pluto:exe:pluto";
});
}