feat(tf): proxprovider

This commit is contained in:
arcnmx 2024-01-26 14:53:04 -08:00
parent b4cbaf5ee1
commit e37624bb2a
9 changed files with 124 additions and 15 deletions

View file

@ -0,0 +1,37 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib.modules) mkAfter;
username = "tf-proxmox";
sshJump = pkgs.writeShellScript "ssh-jump-${username}" ''
exec ssh -T \
-oUpdateHostKeys=yes \
-i ${config.sops.secrets.tf-proxmox-identity.path} \
tf@reisen.local.${config.networking.domain} \
-- "$SSH_ORIGINAL_COMMAND"
'';
in {
users.users.${username} = {
hashedPasswordFile = config.sops.secrets.tf-proxmox-passwd.path;
isNormalUser = true;
};
services.openssh = {
settings = {
KbdInteractiveAuthentication = true;
PasswordAuthentication = true;
};
extraConfig = mkAfter ''
Match User ${username}
ForceCommand ${sshJump}
'';
};
sops.secrets = {
tf-proxmox-passwd = { };
tf-proxmox-identity = {
owner = username;
};
};
}