forked from Plutonomicon/pluto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
66 lines (64 loc) · 2.61 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
{
nixConfig.bash-prompt = "[nix-develop-pluto:] ";
description = "A very basic flake";
inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.plutus.url = "github:input-output-hk/plutus";
inputs.cardano-node.url = "github:input-output-hk/cardano-node";
inputs.plutus-apps.url = "github:input-output-hk/plutus-apps";
outputs = { self, nixpkgs, plutus, flake-utils, haskellNix, cardano-node, plutus-apps }:
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 // {
defaultPackage = flake.packages."pluto:exe:pluto";
});
}