/
interface.nix
46 lines (46 loc) · 1.12 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
{
config,
lib,
dream2nix,
specialArgs,
...
}: let
l = lib // builtins;
t = l.types;
in {
options.nodejs-granular = l.mapAttrs (_: l.mkOption) {
buildScript = {
type = t.nullOr (t.oneOf [t.str t.path t.package]);
description = ''
A command or script to execute instead of `npm run build`.
Is only executed if `runBuild = true`.
'';
};
installMethod = {
type = t.enum [
"symlink"
"copy"
];
description = ''
Strategy to use for populating ./node_modules.
Symlinking is quicker, but often introduces compatibility issues with bundlers like webpack and other build tools.
Copying is slow, but more reliable;
'';
};
runBuild = {
type = t.bool;
description = ''
Whether to run a package's build script (aka. `npm run build`)
'';
};
deps = {
type = t.lazyAttrsOf (t.lazyAttrsOf (t.submoduleWith {
modules = [
dream2nix.modules.dream2nix.core
dream2nix.modules.dream2nix.mkDerivation
];
inherit specialArgs;
}));
};
};
}