-
Notifications
You must be signed in to change notification settings - Fork 10
/
flake-module.nix
46 lines (46 loc) · 1.35 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
45
46
{ lib, self, flake-parts-lib, ... }:
let
inherit (lib)
mkOption
types
;
in
{
options = {
perSystem = flake-parts-lib.mkPerSystemOption ({ config, options, pkgs, ... }:
let cfg = config.rules_ll;
in
{
options = {
rules_ll = {
pkgs = mkOption {
type = types.uniq (types.lazyAttrsOf (types.raw or types.unspecified));
description = lib.mdDoc ''
Nixpkgs to use in the rules_ll [`settings`](#opt-perSystem.rules_ll.settings).
'';
default = pkgs;
defaultText = lib.literalMD "`pkgs` (module argument)";
};
settings = mkOption {
type = types.submoduleWith {
modules = [ ./modules/rules_ll.nix ];
specialArgs = { inherit (cfg) pkgs; };
};
default = { };
description = lib.mdDoc ''
The rules_ll configuration.
'';
};
installationScript = mkOption {
type = types.str;
description = lib.mdDoc "A .bazelrc.ll generator for rules_ll.";
default = cfg.settings.installationScript;
defaultText = lib.literalMD "bazelrc contents";
readOnly = true;
};
};
};
}
);
};
}