30 lines
697 B
Nix
30 lines
697 B
Nix
{ config, ... }:
|
|
let
|
|
homeModules = config.flake.modules.homeManager;
|
|
in
|
|
{
|
|
flake.modules.homeManager.ssh-client =
|
|
{ config, ... }:
|
|
let
|
|
server = config.facts.topology.server;
|
|
in
|
|
{
|
|
imports = [ homeModules.sops ];
|
|
|
|
programs.ssh = {
|
|
enable = true;
|
|
enableDefaultConfig = false;
|
|
includes = [
|
|
config.sops.templates."ssh-config-${server.machine}".path
|
|
];
|
|
};
|
|
|
|
sops.secrets."${server.machine}-ip" = { };
|
|
sops.templates."ssh-config-${server.machine}".content = ''
|
|
Host ${server.sshAlias}
|
|
HostName ${config.sops.placeholder."${server.machine}-ip"}
|
|
ForwardAgent yes
|
|
'';
|
|
};
|
|
}
|