feat: my.git

This commit is contained in:
punkfairie 2025-05-25 20:31:16 -07:00
parent ba90c05b2d
commit 546f73b42b
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
3 changed files with 13 additions and 62 deletions

View file

@ -7,7 +7,7 @@ in {
};
my = {
inherit (cfg.my) name fullName username email;
inherit (cfg.my) name fullName username email git;
};
};
}

View file

@ -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

View file

@ -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;
};
};
}