refactor: simplify source control

This commit is contained in:
2026-04-26 19:11:20 +02:00
parent 2a2b192255
commit 0e29e08c20
5 changed files with 55 additions and 144 deletions
+3 -28
View File
@@ -1,10 +1,5 @@
{ lib, ... }:
let
sourceControlScopeType = lib.types.enum [
"personal"
"work"
];
emailProviderType = lib.types.enum [
"mxrouting"
"office365"
@@ -26,21 +21,6 @@ let
type = lib.mkOption {
type = emailProviderType;
};
scope = lib.mkOption {
type = lib.types.nullOr sourceControlScopeType;
default = null;
};
};
}
);
sourceControlAccountType = lib.types.submodule (
{ ... }:
{
options.projectScope = lib.mkOption {
type = sourceControlScopeType;
default = "personal";
};
}
);
@@ -72,11 +52,6 @@ let
default = { };
};
sourceControl = lib.mkOption {
type = sourceControlAccountType;
default = { };
};
primaryEmail = lib.mkOption {
type = lib.types.nullOr emailType;
description = "Derived primary email entry for this user.";
@@ -133,7 +108,7 @@ let
);
sourceControlMachineKeyType = lib.types.submodule (
{ ... }:
{ name, ... }:
{
options = {
publicKey = lib.mkOption {
@@ -142,8 +117,8 @@ let
};
privateKeyPath = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
type = lib.types.str;
default = "~/.ssh/id_${name}";
};
};
}