ssh: use keyfiles directly, also only include if sops is enabled

This commit is contained in:
Zynh Ludwig 2024-07-28 06:32:16 -07:00
parent 6bb530e404
commit a0befb35e7

View file

@ -3,6 +3,9 @@
let let
cfg = config.snowhawk.ssh; cfg = config.snowhawk.ssh;
sops = config.snowhawk.sops.enable; sops = config.snowhawk.sops.enable;
secrets = config.sops.secrets;
ifSops = lib.mkIf sops;
in in
{ {
options.snowhawk.ssh = { options.snowhawk.ssh = {
@ -22,20 +25,20 @@ in
hostname = "git.zynh.me"; hostname = "git.zynh.me";
user = "git"; user = "git";
port = 2221; port = 2221;
identityFile = "${sshDir}/personal_git"; identityFile = ifSops secrets."private_keys/personal_git".path;
}; };
msiserver = { msiserver = {
hostname = "scarlet.zynh.me"; hostname = "scarlet.zynh.me";
user = "zynh"; user = "zynh";
identityFile = "${sshDir}/msiserver"; identityFile = ifSops secrets."private_keys/msiserver".path;
}; };
"msiserver.local" = lib.mkIf cfg.homeNetwork { "msiserver.local" = lib.mkIf cfg.homeNetwork {
hostname = "msiserver"; hostname = "msiserver";
user = "zynh"; user = "zynh";
identityFile = "${sshDir}/msiserver"; identityFile = ifSops secrets."private_keys/msiserver".path;
}; };
caveserver = { caveserver = {
identityFile = "${sshDir}/caveserver"; identityFile = ifSops secrets."private_keys/caveserver".path;
}; };
}; };
}; };