2024-11-15 17:44:46 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
2025-01-13 21:05:10 -08:00
|
|
|
}: {
|
2024-11-16 22:34:40 -08:00
|
|
|
options.marleyos.my = rec {
|
2025-01-13 21:05:10 -08:00
|
|
|
name = lib.mkOption {
|
|
|
|
type = with lib.types; str;
|
2024-11-15 17:44:46 -08:00
|
|
|
default = config.snowfallorg.user.name or "marley";
|
|
|
|
description = "Your username, for use as your login name.";
|
|
|
|
};
|
|
|
|
|
2025-01-13 21:05:10 -08:00
|
|
|
username = lib.mkOption {
|
|
|
|
type = with lib.types; str;
|
2024-11-15 17:44:46 -08:00
|
|
|
default = name;
|
|
|
|
description = "Your username, for external profiles.";
|
|
|
|
};
|
|
|
|
|
2025-01-13 21:05:10 -08:00
|
|
|
fullName = lib.mkOption {
|
|
|
|
type = with lib.types; str;
|
2024-11-15 17:44:46 -08:00
|
|
|
default = name;
|
|
|
|
description = "Your full name, for display purposes.";
|
|
|
|
};
|
|
|
|
|
2025-01-13 21:05:10 -08:00
|
|
|
email = lib.mkOption {
|
|
|
|
type = with lib.types; nullOr str;
|
2024-11-15 17:44:46 -08:00
|
|
|
default = null;
|
|
|
|
description = "Your email";
|
|
|
|
};
|
|
|
|
|
2025-01-13 21:05:10 -08:00
|
|
|
git.name = lib.mkOption {
|
|
|
|
type = with lib.types; str;
|
2024-11-15 18:30:52 -08:00
|
|
|
default = username;
|
2024-11-15 17:44:46 -08:00
|
|
|
description = "Your git committer name.";
|
|
|
|
};
|
|
|
|
|
2025-01-13 21:05:10 -08:00
|
|
|
git.email = lib.mkOption {
|
|
|
|
type = with lib.types; nullOr str;
|
2024-11-15 17:44:46 -08:00
|
|
|
default = email;
|
|
|
|
description = "Your git committer email.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2025-01-13 21:05:10 -08:00
|
|
|
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;
|
2024-11-15 17:44:46 -08:00
|
|
|
};
|
2025-01-13 21:05:10 -08:00
|
|
|
};
|
2024-11-15 17:44:46 -08:00
|
|
|
}
|