feat: my.git
This commit is contained in:
parent
ba90c05b2d
commit
546f73b42b
3 changed files with 13 additions and 62 deletions
|
@ -7,7 +7,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
my = {
|
my = {
|
||||||
inherit (cfg.my) name fullName username email;
|
inherit (cfg.my) name fullName username email git;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,18 @@
|
||||||
default = null;
|
default = null;
|
||||||
description = "Your email";
|
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
|
config = let
|
||||||
|
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue