-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhome-manager.nix
86 lines (70 loc) · 2.19 KB
/
home-manager.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
{ config, lib, ... }:
with lib;
let
cfg = config.caches;
nixosCache = {
url = "https://cache.nixos.org";
key = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=";
};
cachixCaches = map (import ./fetchCachix.nix) cfg.cachix;
substituters = concatStringsSep " " (map (v: v.url) cfg.caches);
publicKeys = concatStringsSep " " (concatMap (v: v.keys or [ v.key ]) cfg.caches);
nixSettings = {
inherit substituters;
trusted-public-keys = publicKeys;
};
in
{
options.caches = {
caches = mkOption {
description = ''
Caches to write to .config/nix/nix.conf.
It is recommended you use `caches.cachix` and `caches.extraCaches` instead of setting this directly.
If this value is set, the values of `caches.extraCaches` and `caches.cachix` will be ignored.
The names are ignored.
Example value:
[
{
url = "https://cache.nixos.org";
key = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=";
}
]
'';
type = with types; listOf attrs;
default = cachixCaches ++ cfg.extraCaches ++ [ nixosCache ];
};
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;
}