-
Notifications
You must be signed in to change notification settings - Fork 3
/
home-manager-experimental.nix
61 lines (51 loc) · 1.46 KB
/
home-manager-experimental.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
{ config, lib, ... }:
with lib;
let
cfg = config.caches;
caches =
let toCachix = import ./fetchCachix.nix;
in map toCachix cfg.cachix ++ cfg.extraCaches;
substituters = concatStringsSep " " (map (v: v.url) caches);
publicKeys = concatStringsSep " " (concatMap (v: v.keys or [ v.key ]) caches);
nixSettings = {
extra-substituters = substituters;
extra-trusted-public-keys = publicKeys;
};
in
{
options.caches = {
extraCaches = mkOption {
description = ''
Caches to append to .config/nix/nix.conf.
The names are ignored.
Same as caches.caches, but composes with caches.cachix and leaves the
default nixos cache intact.
Example value:
[
{
url = "https://hydra.iohk.io";
key = "hydra.iohk.io:********************************************";
}
]
'';
type = with types; listOf attrs;
default = [ ];
};
cachix = mkOption {
description = ''
Cachix caches to append to .config/nix/nix.conf.
Accepts two configuration formats; either as a string, or an attribute
set with a specified sha (recommended).
Example value:
[
"someCachix"
"someOtherCachix"
{ name = "someCachixWithSha"; sha256 = "..."; }
]
'';
default = [ ];
type = with types; listOf (either str attrs);
};
};
config.nix.settings = nixSettings;
}