marleyos/modules/home/programs/ssh/default.nix

38 lines
708 B
Nix
Raw Normal View History

2024-11-16 19:43:34 -08:00
{
lib,
config,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.marleyos) mkEnableModule;
2024-11-16 19:43:34 -08:00
cfg = config.marleyos.programs.ssh;
2024-11-16 19:43:34 -08:00
in
{
2024-11-16 23:05:17 -08:00
options.marleyos = mkEnableModule "programs.ssh";
2024-11-16 19:43:34 -08:00
config = mkIf cfg.enable {
programs.ssh = {
enable = true;
# Equivalent of ~/.ssh/config
# %d - local user's home directory
# %r - remote username
matchBlocks = {
"tty.marleycentre" = {
hostname = "10.10.10.69";
identityFile = "%d/.ssh/%r@marleycentre";
};
"tty.marleynet" = {
hostname = "10.69.69.2";
port = 222;
identityFile = "%d/.ssh/%r@marleynet";
};
};
};
};
}