mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
feat(tf): proxprovider
This commit is contained in:
parent
b4cbaf5ee1
commit
e37624bb2a
9 changed files with 124 additions and 15 deletions
37
systems/hakurei/reisen-ssh.nix
Normal file
37
systems/hakurei/reisen-ssh.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue