ssh: refactor

main
Zynh Ludwig 2024-07-28 14:18:38 -07:00
parent 08369e38e1
commit d5f96ae6e5
1 changed files with 7 additions and 5 deletions

View File

@ -6,6 +6,8 @@ let
secrets = config.sops.secrets;
ifSops = lib.mkIf sops;
keyPathIfSops = key: ifSops secrets.${key}.path;
in
{
options.snowhawk.ssh = {
@ -25,23 +27,23 @@ in
hostname = "git.zynh.me";
user = "git";
port = 2221;
identityFile = ifSops secrets."private_keys/personal_git".path;
identityFile = keyPathIfSops "private_keys/personal_git";
};
snowhawk = {
identityFile = ifSops secrets."private_keys/snowhawk".path;
identityFile = keyPathIfSops "private_keys/snowhawk";
};
msiserver = {
hostname = "scarlet.zynh.me";
user = "zynh";
identityFile = ifSops secrets."private_keys/msiserver".path;
identityFile = keyPathIfSops "private_keys/msiserver";
};
"msiserver.local" = lib.mkIf cfg.homeNetwork {
hostname = "msiserver";
user = "zynh";
identityFile = ifSops secrets."private_keys/msiserver".path;
identityFile = keyPathIfSops "private_keys/msiserver";
};
caveserver = {
identityFile = ifSops secrets."private_keys/caveserver".path;
identityFile = keyPathIfSops "private_keys/caveserver";
};
};
};