forked from TraceMachina/nativelink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake-module.nix
44 lines (44 loc) · 1.21 KB
/
flake-module.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
{
lib,
flake-parts-lib,
...
}: {
options = {
perSystem = flake-parts-lib.mkPerSystemOption (
{
config,
options,
pkgs,
...
}: let
cfg = config.nativelink;
in {
options = {
nativelink = {
pkgs = lib.mkOption {
type = lib.types.uniq (lib.types.lazyAttrsOf (lib.types.raw or lib.types.unspecified));
description = "Nixpkgs to use.";
default = pkgs;
defaultText = lib.literalMD "`pkgs` (module argument)";
};
settings = lib.mkOption {
type = lib.types.submoduleWith {
modules = [./modules/nativelink.nix];
specialArgs = {inherit (cfg) pkgs;};
};
default = {};
description = "Configuration for Bazel on Darwin.";
};
installationScript = lib.mkOption {
type = lib.types.str;
description = "Create nativelink.bazelrc.";
default = cfg.settings.installationScript;
defaultText = lib.literalMD "bazelrc content";
readOnly = true;
};
};
};
}
);
};
}