/
interface.nix
60 lines (55 loc) · 1.3 KB
/
interface.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
{
config,
lib,
...
}: let
l = lib // builtins;
t = l.types;
in {
options.eval-cache = {
# LOCAL OPTIONS
enable = l.mkEnableOption "the evaluation cache for this derivation";
content = l.mkOption {
type = t.submodule {
freeformType = t.anything;
};
internal = true;
description = ''
The content of the cached fields.
For example if fields.pname is set to true, then content.pname will exist.
'';
};
invalidationFields = l.mkOption {
type = t.attrsOf t.anything;
internal = true;
description = "Fields, when changed, require refreshing the cache";
default = {};
example = {
src = true;
};
};
fields = l.mkOption {
type = t.attrsOf t.anything;
internal = true;
description = "Fields for which to cache evaluation";
default = {};
example = {
pname = true;
version = true;
};
};
# INTERNAL OPTIONS
newFile = l.mkOption {
type = t.path;
description = "Cache file generated from the current inputs";
internal = true;
readOnly = true;
};
refresh = l.mkOption {
type = t.path;
internal = true;
description = "Script to refresh the eval cache file";
readOnly = true;
};
};
}