feat: add source control identity management

This commit is contained in:
2026-04-22 01:02:27 +02:00
parent be6ad78637
commit 86446fa797
10 changed files with 327 additions and 30 deletions
+117 -24
View File
@@ -26,6 +26,69 @@ let
}
);
sourceControlHostKeyType = lib.types.submodule (
{ ... }:
{
options = {
publicKey = lib.mkOption {
type = lib.types.str;
};
privateKeyPath = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
};
};
}
);
sourceControlHostUserType = lib.types.submodule (
{ ... }:
{
options = {
personal = mkNullableOption sourceControlHostKeyType;
work = mkNullableOption sourceControlHostKeyType;
};
}
);
hostSourceControlType = lib.types.submodule (
{ ... }:
{
options.users = lib.mkOption {
type = lib.types.attrsOf sourceControlHostUserType;
default = { };
};
}
);
sourceControlProfileType = lib.types.submodule (
{ ... }:
{
options = { };
}
);
sourceControlType = lib.types.submodule (
{ ... }:
{
options = {
profiles = lib.mkOption {
type = lib.types.attrsOf sourceControlProfileType;
default = { };
};
projectScope = lib.mkOption {
type = lib.types.enum [
"personal"
"work"
];
default = "personal";
};
};
}
);
userType = lib.types.submodule (
{ config, ... }:
{
@@ -54,6 +117,11 @@ let
emails = lib.mkOption {
type = lib.types.attrsOf emailType;
};
sourceControl = lib.mkOption {
type = sourceControlType;
default = { };
};
};
}
);
@@ -111,20 +179,28 @@ let
{ ... }:
{
options = {
accelProfile = mkNullableOption (lib.types.nullOr (lib.types.enum [
"adaptive"
"flat"
]));
accelProfile = mkNullableOption (
lib.types.nullOr (
lib.types.enum [
"adaptive"
"flat"
]
)
);
accelSpeed = mkNullableOption (lib.types.nullOr lib.types.float);
leftHanded = mkNullableOption (lib.types.nullOr lib.types.bool);
middleEmulation = mkNullableOption (lib.types.nullOr lib.types.bool);
naturalScrolling = mkNullableOption (lib.types.nullOr lib.types.bool);
scrollMethod = mkNullableOption (lib.types.nullOr (lib.types.enum [
"no-scroll"
"two-finger"
"edge"
"on-button-down"
]));
scrollMethod = mkNullableOption (
lib.types.nullOr (
lib.types.enum [
"no-scroll"
"two-finger"
"edge"
"on-button-down"
]
)
);
};
}
);
@@ -133,25 +209,37 @@ let
{ ... }:
{
options = {
accelProfile = mkNullableOption (lib.types.nullOr (lib.types.enum [
"adaptive"
"flat"
]));
accelProfile = mkNullableOption (
lib.types.nullOr (
lib.types.enum [
"adaptive"
"flat"
]
)
);
accelSpeed = mkNullableOption (lib.types.nullOr lib.types.float);
clickMethod = mkNullableOption (lib.types.nullOr (lib.types.enum [
"button-areas"
"clickfinger"
]));
clickMethod = mkNullableOption (
lib.types.nullOr (
lib.types.enum [
"button-areas"
"clickfinger"
]
)
);
disableWhileTyping = mkNullableOption (lib.types.nullOr lib.types.bool);
leftHanded = mkNullableOption (lib.types.nullOr lib.types.bool);
middleEmulation = mkNullableOption (lib.types.nullOr lib.types.bool);
naturalScrolling = mkNullableOption (lib.types.nullOr lib.types.bool);
scrollMethod = mkNullableOption (lib.types.nullOr (lib.types.enum [
"no-scroll"
"two-finger"
"edge"
"on-button-down"
]));
scrollMethod = mkNullableOption (
lib.types.nullOr (
lib.types.enum [
"no-scroll"
"two-finger"
"edge"
"on-button-down"
]
)
);
tapping = mkNullableOption (lib.types.nullOr lib.types.bool);
};
}
@@ -196,6 +284,11 @@ let
type = lib.types.attrsOf userType;
default = { };
};
sourceControl = lib.mkOption {
type = hostSourceControlType;
default = { };
};
};
}
);