-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
147 lines (136 loc) · 7.27 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{
# From https://github.com/Liqwid-Labs/plutus-extra/blob/cc303f95762c7f23f27abf54c527ac510dbabba6/flake.nix
description = "shrinker";
inputs.haskell-nix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable";
inputs.haskell-nix.inputs.nixpkgs.follows = "haskell-nix/nixpkgs-2105";
inputs.plutus.url = "github:input-output-hk/plutus"; # used for libsodium-vrf
outputs = { self, nixpkgs, haskell-nix, plutus }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
perSystem = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = system: import nixpkgs { inherit system; overlays = [ haskell-nix.overlay ]; inherit (haskell-nix) config; };
projectFor = system:
let
deferPluginErrors = true;
pkgs = nixpkgsFor system;
fakeSrc = pkgs.runCommand "real-source" {} ''
cp -rT ${self} $out
chmod u+w $out/cabal.project
cat $out/cabal-haskell.nix.project >> $out/cabal.project
'';
in
(nixpkgsFor system).haskell-nix.cabalProject' {
src = fakeSrc.outPath;
compiler-nix-name = "ghc8107";
cabalProjectFileName = "cabal.project";
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 =
nixpkgs.lib.mkForce [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ];
cardano-crypto-class.components.library.pkgconfig =
nixpkgs.lib.mkForce [ [ (import plutus { inherit system; }).pkgs.libsodium-vrf ] ];
};
}];
shell = {
withHoogle = true;
exactDeps = true;
# We use the ones from Nixpkgs, since they are cached reliably.
# Eventually we will probably want to build these with haskell.nix.
nativeBuildInputs = [ pkgs.cabal-install pkgs.hlint pkgs.haskellPackages.fourmolu ];
additional = ps: [
ps.base-deriving-via
ps.cardano-addresses
ps.cardano-addresses-cli
ps.cardano-binary
ps.cardano-crypto
ps.cardano-crypto-class
ps.cardano-crypto-praos
ps.cardano-crypto-wrapper
ps.cardano-ledger-alonzo
ps.cardano-ledger-byron
ps.cardano-ledger-core
ps.cardano-ledger-pretty
ps.cardano-ledger-shelley
ps.cardano-ledger-shelley-ma
ps.cardano-prelude
ps.cardano-slotting
ps.flat
ps.freer-extras
ps.goblins
ps.measures
ps.orphans-deriving-via
ps.plutus-contract
ps.plutus-core
ps.plutus-ledger
ps.plutus-ledger-api
ps.plutus-tx
ps.plutus-tx-plugin
ps.prettyprinter-configurable
ps.quickcheck-dynamic
ps.Win32-network
ps.word-array
#ps.tasty-expected-failure
];
};
sha256map = {
"https://github.com/input-output-hk/plutus.git"."c8c5183f7facd967d48fe07b3b14465b8dd48fe7"
= "SrJgiww5Lcf8yEmjoZZh8RntZx06DEapTTChcttU1QU=";
"https://github.com/input-output-hk/plutus-apps.git"."404af7ac3e27ebcb218c05f79d9a70ca966407c9"
= "+T9TGzHEzyfixBysxLwy5VWVrL5xqKF5pcbRlHQr+wI=";
"https://github.com/Quid2/flat.git"."ee59880f47ab835dbd73bea0847dab7869fc20d8"
= "lRFND+ZnZvAph6ZYkr9wl9VAx41pb3uSFP8Wc7idP9M=";
"https://github.com/input-output-hk/purescript-bridge.git"."366fc70b341e2633f3ad0158a577d52e1cd2b138"
= "paaId4GJ9/Z5LstYfakiCJZ2p9Q5NMHXdXUx5rTPQKI=";
"https://github.com/input-output-hk/servant-purescript.git"."ebea59c7bdfc0338d83fca772b9a57e28560bcde"
= "VkM9Q2XkDEnQh6khptoIjQ9xW7Fc2wsOJ4vPYDzBTD4=";
"https://github.com/input-output-hk/cardano-crypto.git"."07397f0e50da97eaa0575d93bee7ac4b2b2576ec"
= "oxIOVlgm07FAEmgGRF1C2me9TXqVxQulEOcJ22zpTRs=";
"https://github.com/input-output-hk/cardano-base"."4ea7e2d927c9a7f78ddc69738409a5827ab66b98"
= "zbjq43Bnhv1/LhJCFlI8gdd61dGvVlkEa6wkCvLqEFg=";
"https://github.com/input-output-hk/cardano-prelude"."fd773f7a58412131512b9f694ab95653ac430852"
= "BtbT5UxOAADvQD4qTPNrGfnjQNgbYNO4EAJwH2ZsTQo=";
"https://github.com/input-output-hk/cardano-addresses"."d2f86caa085402a953920c6714a0de6a50b655ec"
= "XgXQKJHRKAFwIjONh19D/gKE0ARlhMXXcV74eZpd0lw=";
"https://github.com/j-mueller/cardano-ledger-specs"."bf008ce028751cae9fb0b53c3bef20f07c06e333"
= "HTPOmVOXgBD/3uAxZip/HSttaKcJ+uImYDbuwANAw1c=";
"https://github.com/input-output-hk/cardano-node.git"."b6ca519f97a0e795611a63174687e6bb70c9f752"
= "tuEtSCJOk1MA9sguxL13XLa+qHaz//v7eNyhxHC9tHw=";
"https://github.com/input-output-hk/optparse-applicative"."7497a29cb998721a9068d5725d49461f2bba0e7a"
= "uQx+SEYsCH7JcG3xAT0eJck9yq3y0cvx49bvItLLer8=";
"https://github.com/input-output-hk/Win32-network"."3825d3abf75f83f406c1f7161883c438dac7277d"
= "Hesb5GXSx0IwKSIi42ofisVELcQNX6lwHcoZcbaDiqc=";
"https://github.com/input-output-hk/goblins"."cde90a2b27f79187ca8310b6549331e59595e7ba"
= "z9ut0y6umDIjJIRjz9KSvKgotuw06/S8QDwOtVdGiJ0=";
"https://github.com/nomeata/tasty-expected-failure.git"."33b71e694b954e35c05859fff3ca886d8cfe5bfe"
= "C/IWktTILklfPEAht/RE4IC8to6MrvrLmmbqgWsJlIM=";
"https://github.com/mlabs-haskell/pluto.git"."d1f008be8509e20677027c0477a59af49db3ad78"
= "AR8C1KtfIeFbMSp9dWmC09Dddtj9Gbk7YLVsJG6J1dQ=";
"https://github.com/input-output-hk/cardano-wallet"."6be73ab852c0592713dfe78218856d4a8a0ee69e"
= "5IZuqlE/4aGH3TEuGYQsZwOpI/Q7DYzJ4q3stuqGpWc=";
"https://github.com/input-output-hk/ouroboros-network"."1f4973f36f689d6da75b5d351fb124d66ef1057d"
= "lwTgyoZBQAaU6Sh7BouGJGUvK1tSVrWhJP63v7MpwKA=";
"https://github.com/input-output-hk/iohk-monitoring-framework"."46f994e216a1f8b36fe4669b47b2a7011b0e153c"
= "QE3QRpIHIABm+qCP/wP4epbUx0JmSJ9BMePqWEd3iMY=";
};
};
in
{
project = perSystem projectFor;
flake = perSystem (system: (projectFor system).flake {});
# this could be done automatically, but would reduce readability
packages = perSystem (system: self.flake.${system}.packages);
checks = perSystem (system: self.flake.${system}.checks);
check = perSystem (system:
(nixpkgsFor system).runCommand "combined-test" {
nativeBuildInputs = builtins.attrValues self.checks.${system};
} "touch $out"
);
apps = perSystem (system: self.flake.${system}.apps);
devShell = perSystem (system: self.flake.${system}.devShell);
};
}