types: create fontType option type

This commit is contained in:
ivann 2020-02-23 11:11:12 +01:00 committed by Robert Helgesson
parent 4e50809c78
commit 9bddef74df
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 24 additions and 24 deletions

View file

@ -33,4 +33,27 @@ in
foldl' (res: def: mergeAttrs res (def.value self super)) {} defs; foldl' (res: def: mergeAttrs res (def.value self super)) {} defs;
}; };
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.
'';
};
};
};
} }

View file

@ -27,29 +27,6 @@ let
in in
"${n} = ${v'}"; "${n} = ${v'}";
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.
'';
};
};
};
themeType = types.submodule { themeType = types.submodule {
options = { options = {
package = mkOption { package = mkOption {
@ -87,7 +64,7 @@ in
enable = mkEnableOption "GTK 2/3 configuration"; enable = mkEnableOption "GTK 2/3 configuration";
font = mkOption { font = mkOption {
type = types.nullOr fontType; type = types.nullOr hm.types.fontType;
default = null; default = null;
description = '' description = ''
The font to use in GTK+ 2/3 applications. The font to use in GTK+ 2/3 applications.