-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
103 lines (92 loc) · 2.98 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
{
description = "Pure Haskell BIP39 hierarchical deterministic wallets.";
inputs = {
ppad-nixpkgs = {
type = "git";
url = "git://git.ppad.tech/nixpkgs.git";
ref = "master";
};
ppad-bip32 = {
type = "git";
url = "git://git.ppad.tech/bip32.git";
ref = "master";
inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
inputs.ppad-base16.follows = "ppad-base16";
inputs.ppad-sha256.follows = "ppad-sha256";
inputs.ppad-sha512.follows = "ppad-sha512";
};
ppad-base16 = {
type = "git";
url = "git://git.ppad.tech/base16.git";
ref = "master";
inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
};
ppad-sha256 = {
type = "git";
url = "git://git.ppad.tech/sha256.git";
ref = "master";
inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
};
ppad-sha512 = {
type = "git";
url = "git://git.ppad.tech/sha512.git";
ref = "master";
inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
};
ppad-pbkdf = {
type = "git";
url = "git://git.ppad.tech/pbkdf.git";
ref = "master";
inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
inputs.ppad-sha256.follows = "ppad-sha256";
inputs.ppad-sha512.follows = "ppad-sha512";
};
flake-utils.follows = "ppad-nixpkgs/flake-utils";
nixpkgs.follows = "ppad-nixpkgs/nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, ppad-nixpkgs
, ppad-sha256, ppad-sha512
, ppad-base16
, ppad-bip32
, ppad-pbkdf
}:
flake-utils.lib.eachDefaultSystem (system:
let
lib = "ppad-bip39";
pkgs = import nixpkgs { inherit system; };
hlib = pkgs.haskell.lib;
hpkgs = pkgs.haskell.packages.ghc981.extend (new: old: {
${lib} = old.callCabal2nixWithOptions lib ./. "--enable-profiling" {};
ppad-bip32 = ppad-bip32.packages.${system}.default;
ppad-base16 = ppad-base16.packages.${system}.default;
ppad-sha256 = ppad-sha256.packages.${system}.default;
ppad-sha512 = ppad-sha512.packages.${system}.default;
ppad-pbkdf = ppad-pbkdf.packages.${system}.default;
});
cc = pkgs.stdenv.cc;
ghc = hpkgs.ghc;
cabal = hpkgs.cabal-install;
in
{
packages.default = hpkgs.${lib};
devShells.default = hpkgs.shellFor {
packages = p: [
(hlib.doBenchmark p.${lib})
];
buildInputs = [
cabal
cc
];
inputsFrom = builtins.attrValues self.packages.${system};
doBenchmark = true;
shellHook = ''
PS1="[${lib}] \w$ "
echo "entering ${system} shell, using"
echo "cc: $(${cc}/bin/cc --version)"
echo "ghc: $(${ghc}/bin/ghc --version)"
echo "cabal: $(${cabal}/bin/cabal --version)"
'';
};
}
);
}