2020-01-14 23:41:59 +01:00
|
|
|
{ lib, dag ? import ./dag.nix { inherit lib; } }:
|
2018-12-29 21:21:11 +01:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2020-01-14 23:41:59 +01:00
|
|
|
let
|
|
|
|
|
|
|
|
typesDag = import ./types-dag.nix { inherit dag lib; };
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2018-12-29 21:21:11 +01:00
|
|
|
{
|
|
|
|
|
2020-01-14 23:41:59 +01:00
|
|
|
inherit (typesDag) dagOf listOrDagOf;
|
|
|
|
|
2018-12-29 21:21:11 +01:00
|
|
|
selectorFunction = mkOptionType {
|
|
|
|
name = "selectorFunction";
|
|
|
|
description =
|
|
|
|
"Function that takes an attribute set and returns a list"
|
|
|
|
+ " containing a selection of the values of the input set";
|
|
|
|
check = isFunction;
|
|
|
|
merge = _loc: defs:
|
|
|
|
as: concatMap (select: select as) (getValues defs);
|
|
|
|
};
|
|
|
|
|
|
|
|
overlayFunction = mkOptionType {
|
|
|
|
name = "overlayFunction";
|
|
|
|
description =
|
|
|
|
"An overlay function, takes self and super and returns"
|
|
|
|
+ " an attribute set overriding the desired attributes.";
|
|
|
|
check = isFunction;
|
|
|
|
merge = _loc: defs:
|
|
|
|
self: super:
|
|
|
|
foldl' (res: def: mergeAttrs res (def.value self super)) {} defs;
|
|
|
|
};
|
|
|
|
|
2020-02-23 11:11:12 +01:00
|
|
|
fontType = types.submodule {
|
|
|
|
options = {
|
|
|
|
package = mkOption {
|
|
|
|
type = types.nullOr types.package;
|
|
|
|
default = null;
|
|
|
|
example = literalExample "pkgs.dejavu_fonts";
|
|
|
|
description = ''
|
|
|
|
Package providing the font. This package will be installed
|
|
|
|
to your profile. If <literal>null</literal> then the font
|
|
|
|
is assumed to already be available in your profile.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
name = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
example = "DejaVu Sans 8";
|
|
|
|
description = ''
|
|
|
|
The family name and size of the font within the package.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-12-29 21:21:11 +01:00
|
|
|
}
|