flocon/modules/options/homeVars.nix
Anthony Rodriguez ed3dde6c28
options: provide defaults for user and fullName
This fixes users not being present, even on the server. We have to
create a placeholder user, even if we're only going to ssh as root.
2025-02-13 16:42:58 +01:00

38 lines
845 B
Nix

{
config,
lib,
options,
...
}: let
inherit (lib) mkIf mkOption;
inherit (lib.types) str;
in {
options.local.homeVars = {
fullName = mkOption {
type = str;
description = "your full name (used for git commits and user description)";
default = "User";
};
email = mkOption {
type = str;
description = "your email (used for git commits)";
default = null;
};
signingKey = mkOption {
type = str;
description = "your ssh public key (used for signing git commits)";
};
};
config.assertions = mkIf (!config.local.profiles.server.enable) [
{
assertion = options.local.homeVars.fullName.isDefined;
}
{
assertion = options.local.homeVars.email.isDefined;
}
{
assertion = options.local.homeVars.signingKey.isDefined;
}
];
}