forked from input-output-hk/cardano-sl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.nix
37 lines (36 loc) · 1.01 KB
/
lib.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
let
sources = import ./nix/sources.nix;
pkgs' = import sources.nixpkgs {};
haskellNixJson = let
src = sources."haskell.nix";
in __toJSON {
inherit (sources."haskell.nix") rev sha256;
url = "https://github.com/${src.owner}/${src.repo}";
};
iohkNix = import sources.iohk-nix { haskellNixJsonOverride = pkgs'.writeText "haskell-nix.json" haskellNixJson; };
pkgs = iohkNix.pkgs;
lib = pkgs.lib;
niv = (import sources.niv {}).niv;
maybeEnv = env: default:
let
result = builtins.getEnv env;
in if result != ""
then result
else default;
environments = iohkNix.cardanoLib.environments // {
demo = {
confKey = "dev";
relays = "127.0.0.1";
private = true;
};
};
forEnvironments = f: lib.mapAttrs
(name: env: f (env // { inherit name; }))
environments;
in lib // iohkNix.cardanoLib // iohkNix // {
inherit environments forEnvironments niv iohkNix;
utf8LocaleSetting = ''
export LC_ALL=en_GB.UTF-8
export LANG=en_GB.UTF-8
'';
}