From 546f73b42b036529d2c21ce7224ff8cfb6be6b32 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sun, 25 May 2025 20:31:16 -0700 Subject: [PATCH] feat: my.git --- modules/home/option-inheritance.nix | 2 +- modules/options/my.nix | 12 ++++ snowflake/modules/home/options/my/default.nix | 61 ------------------- 3 files changed, 13 insertions(+), 62 deletions(-) delete mode 100644 snowflake/modules/home/options/my/default.nix diff --git a/modules/home/option-inheritance.nix b/modules/home/option-inheritance.nix index 6b9e160..b23df85 100644 --- a/modules/home/option-inheritance.nix +++ b/modules/home/option-inheritance.nix @@ -7,7 +7,7 @@ in { }; my = { - inherit (cfg.my) name fullName username email; + inherit (cfg.my) name fullName username email git; }; }; } diff --git a/modules/options/my.nix b/modules/options/my.nix index b35e583..b0bbd2e 100644 --- a/modules/options/my.nix +++ b/modules/options/my.nix @@ -27,6 +27,18 @@ default = null; description = "Your email"; }; + + git.name = lib.mkOption { + type = with lib.types; str; + default = username; + description = "Your git committer name."; + }; + + git.email = lib.mkOption { + type = with lib.types; nullOr str; + default = email; + description = "Your git committer email."; + }; }; config = let diff --git a/snowflake/modules/home/options/my/default.nix b/snowflake/modules/home/options/my/default.nix deleted file mode 100644 index d2d14c2..0000000 --- a/snowflake/modules/home/options/my/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - lib, - config, - ... -}: { - options.marleyos.my = rec { - name = lib.mkOption { - type = with lib.types; str; - default = config.snowfallorg.user.name or "marley"; - description = "Your username, for use as your login name."; - }; - - username = lib.mkOption { - type = with lib.types; str; - default = name; - description = "Your username, for external profiles."; - }; - - fullName = lib.mkOption { - type = with lib.types; str; - default = name; - description = "Your full name, for display purposes."; - }; - - email = lib.mkOption { - type = with lib.types; nullOr str; - default = null; - description = "Your email"; - }; - - git.name = lib.mkOption { - type = with lib.types; str; - default = username; - description = "Your git committer name."; - }; - - git.email = lib.mkOption { - type = with lib.types; nullOr str; - default = email; - description = "Your git committer email."; - }; - }; - - config = let - cfg = config.marleyos.my; - in { - assertions = [ - { - assertion = cfg.name != null; - message = "marleyos.my.name must be set."; - } - ]; - - home.username = lib.mkDefault cfg.name; - - programs.git = { - userName = lib.mkDefault cfg.git.name; - userEmail = lib.mkDefault cfg.git.email; - }; - }; -}