-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdefault.nix
40 lines (34 loc) · 842 Bytes
/
default.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
{ config, lib, options, ... }:
with lib;
let
cachices = map (import ./fetchCachix.nix) config.cachix;
urls = map (c: c.url) cachices;
keys = concatMap (c: c.keys) cachices;
in
{
options.cachix = mkOption {
type = with types; listOf (either str attrs);
default = [ ];
description = ''
Accepts two configuration formats; either as a string, or an attribute
set with a specified sha (recommended).
Example value:
[
"someCachix"
"someOtherCachix"
{ name = "someCachixWithSha"; sha256 = "..."; }
]
'';
};
config =
if options.nix ? settings then
{
nix.settings.substituters = urls;
nix.settings.trusted-public-keys = keys;
}
else
{
nix.binaryCaches = urls;
nix.binaryCachePublicKeys = keys;
};
}