aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivann <ivann@0xf.re>2020-02-23 11:11:12 +0100
committerRobert Helgesson <robert@rycee.net>2020-02-23 11:18:59 +0100
commit9bddef74dfe95658df20625b6a6f701fa942e29b (patch)
tree4422beb6e931f962486ac80bd734a983694d62c9
parent4e50809c78c1d3241c063987292960e7173f8573 (diff)
types: create fontType option type
-rw-r--r--modules/lib/types.nix23
-rw-r--r--modules/misc/gtk.nix25
2 files changed, 24 insertions, 24 deletions
diff --git a/modules/lib/types.nix b/modules/lib/types.nix
index 78a875f519e..fb871cf8188 100644
--- a/modules/lib/types.nix
+++ b/modules/lib/types.nix
@@ -33,4 +33,27 @@ in
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.
+ '';
+ };
+ };
+ };
+
}
diff --git a/modules/misc/gtk.nix b/modules/misc/gtk.nix
index 1222db4ecab..2f080b5b54d 100644
--- a/modules/misc/gtk.nix
+++ b/modules/misc/gtk.nix
@@ -27,29 +27,6 @@ let
in
"${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 {
options = {
package = mkOption {
@@ -87,7 +64,7 @@ in
enable = mkEnableOption "GTK 2/3 configuration";
font = mkOption {
- type = types.nullOr fontType;
+ type = types.nullOr hm.types.fontType;
default = null;
description = ''
The font to use in GTK+ 2/3 applications.