ssh: use ssh dir instead of homedir

main
Zynh Ludwig 2024-07-28 06:11:49 -07:00
parent afdd0a22f3
commit 6bb530e404
1 changed files with 10 additions and 9 deletions

View File

@ -12,7 +12,7 @@ in
};
config =
let home = config.home.homeDirectory + "/.ssh";
let sshDir = config.home.homeDirectory + "/.ssh";
in lib.mkIf cfg.enable {
programs.ssh = {
enable = true;
@ -22,28 +22,29 @@ in
hostname = "git.zynh.me";
user = "git";
port = 2221;
identityFile = "${home}/.ssh/personal_git";
identityFile = "${sshDir}/personal_git";
};
msiserver = {
hostname = "scarlet.zynh.me";
user = "zynh";
identityFile = "${home}/.ssh/msiserver";
identityFile = "${sshDir}/msiserver";
};
"msiserver.local" = lib.mkIf cfg.homeNetwork {
hostname = "msiserver";
user = "zynh";
identityFile = "${home}/.ssh/msiserver";
identityFile = "${sshDir}/msiserver";
};
caveserver = {
identityFile = "${home}/.ssh/caveserver";
identityFile = "${sshDir}/caveserver";
};
};
};
sops.secrets = lib.mkIf sops {
"private_keys/msiserver".path = "${home}/.ssh/msiserver";
"private_keys/caveserver".path = "${home}/.ssh/caveserver";
"ssh_hosts/caveserver".path = "${home}/.ssh/conf.d/caveserver_config";
sops.secrets = ifSops {
"private_keys/msiserver" = { };
"private_keys/caveserver" = { };
"ssh_hosts/caveserver".path = "${sshDir}/conf.d/caveserver_config";
};
};
}