From d4f7650cd0735d1fe9173530cc31c24b65ed44ff Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Mon, 3 Jun 2024 20:50:58 +0530 Subject: global/font: init --- global/cez/default.nix | 6 ++++++ global/common/default.nix | 6 ++++++ global/common/modules/font.nix | 36 ++++++++++++++++++++++++++++++++++++ global/common/modules/userdata.nix | 26 ++++++++++++++++++++++++++ global/default.nix | 5 ----- global/userdata.nix | 26 -------------------------- 6 files changed, 74 insertions(+), 31 deletions(-) create mode 100644 global/cez/default.nix create mode 100644 global/common/default.nix create mode 100644 global/common/modules/font.nix create mode 100644 global/common/modules/userdata.nix delete mode 100644 global/default.nix delete mode 100644 global/userdata.nix (limited to 'global') diff --git a/global/cez/default.nix b/global/cez/default.nix new file mode 100644 index 0000000..f4fca99 --- /dev/null +++ b/global/cez/default.nix @@ -0,0 +1,6 @@ +{ ... }: { + global.font = { + sans.size = 13; + monospace.size = 18; + }; +} diff --git a/global/common/default.nix b/global/common/default.nix new file mode 100644 index 0000000..329963d --- /dev/null +++ b/global/common/default.nix @@ -0,0 +1,6 @@ +{ ... }: { + imports = [ + ./modules/font.nix + ./modules/userdata.nix + ]; +} diff --git a/global/common/modules/font.nix b/global/common/modules/font.nix new file mode 100644 index 0000000..cf0ea61 --- /dev/null +++ b/global/common/modules/font.nix @@ -0,0 +1,36 @@ +{ pkgs, lib, ... }: let + name = { + type = lib.types.str; + example = "Terminess Nerd Font"; + }; + size = { + type = with lib.types; nullOr int; + default = null; + }; + packages = { + type = with lib.types; listOf path; + example = "[ pkgs.terminus-nerdfont ]"; + }; +in { + options.global.font = { + sans = { + size = lib.mkOption size; + name = lib.mkOption (name // { + default = "DeepMind Sans"; + }); + packages = lib.mkOption (packages // { + default = [ pkgs.dm-sans ]; + }); + }; + + monospace = { + size = lib.mkOption size; + name = lib.mkOption (name // { + default = "Terminess Nerd Font"; + }); + packages = lib.mkOption (packages // { + default = [ pkgs.terminus-nerdfont ]; + }); + }; + }; +} diff --git a/global/common/modules/userdata.nix b/global/common/modules/userdata.nix new file mode 100644 index 0000000..d591920 --- /dev/null +++ b/global/common/modules/userdata.nix @@ -0,0 +1,26 @@ +{ config, lib, ... }: let + cfg = config.global.userdata; +in { + options.global.userdata = { + name = lib.mkOption { + type = lib.types.str; + default = "sinan"; + description = "Owner's username"; + }; + nameFq = lib.mkOption { + type = lib.types.str; + default = "sinanmohd"; + description = "Owner's fully qualified username"; + }; + domain = lib.mkOption { + type = lib.types.str; + default = "sinanmohd.com"; + description = "Owner's domain"; + }; + email = lib.mkOption { + type = lib.types.str; + default = "${cfg.name}@${cfg.domain}"; + description = "Owner's email"; + }; + }; +} diff --git a/global/default.nix b/global/default.nix deleted file mode 100644 index 5bcb1ba..0000000 --- a/global/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: { - imports = [ - ./userdata.nix - ]; -} diff --git a/global/userdata.nix b/global/userdata.nix deleted file mode 100644 index d591920..0000000 --- a/global/userdata.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, lib, ... }: let - cfg = config.global.userdata; -in { - options.global.userdata = { - name = lib.mkOption { - type = lib.types.str; - default = "sinan"; - description = "Owner's username"; - }; - nameFq = lib.mkOption { - type = lib.types.str; - default = "sinanmohd"; - description = "Owner's fully qualified username"; - }; - domain = lib.mkOption { - type = lib.types.str; - default = "sinanmohd.com"; - description = "Owner's domain"; - }; - email = lib.mkOption { - type = lib.types.str; - default = "${cfg.name}@${cfg.domain}"; - description = "Owner's email"; - }; - }; -} -- cgit v1.2.3