tadpole: Add authorized ssh key for pinwheel

This commit is contained in:
Alexander Heldt
2024-07-20 21:45:13 +02:00
parent f59344809e
commit 03a983cd3a
4 changed files with 28 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
{ lib, config, ... }:
{ pkgs, lib, config, ... }:
let
enabled = config.mod.ssh.enable;
authorizedKeysPath = "/home/alex/.ssh/authorized-keys";
in
{
options = {
@@ -23,7 +25,22 @@ in
};
};
environment.etc."ssh/authorized_keys_command" = {
mode = "0755";
text = ''
#!${pkgs.bash}/bin/bash
for file in ${authorizedKeysPath}/*; do
${pkgs.coreutils}/bin/cat "$file"
done
'';
};
age.secrets = {
"alex.pinwheel-tadpole.pub" = {
file = ../../../../secrets/pinwheel/alex.pinwheel-tadpole.pub.age;
path = "${authorizedKeysPath}/alex.pinwheel-tadpole.pub";
};
"alex.tadpole-codeberg.org" = {
file = ../../../../secrets/tadpole/alex.tadpole-codeberg.org.age;
path = "/home/alex/.ssh/alex.tadpole-codeberg.org";
@@ -47,6 +64,14 @@ in
path = "/etc/ssh/tadpole";
type = "ed25519";
}];
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
authorizedKeysCommand = "/etc/ssh/authorized_keys_command";
authorizedKeysCommandUser = "root";
};
};