add sshd module

This commit is contained in:
Jörg Thalheim 2024-03-13 08:38:20 +01:00
parent 5b02dda003
commit 8ab6fcd4c0
2 changed files with 19 additions and 0 deletions

View File

@ -11,6 +11,7 @@
moonlight = ./moonlight.nix;
sunshine = ./sunshine.nix;
syncthing = ./syncthing.nix;
sshd = ./sshd.nix;
vm-user = ./vm-user.nix;
graphical = ./graphical.nix;
xfce = ./xfce.nix;

18
clanModules/sshd.nix Normal file
View File

@ -0,0 +1,18 @@
{ config, pkgs, ... }: {
services.openssh.enable = true;
services.openssh.hostKeys = [{
path = config.clanCore.secrets.borgbackup.secrets."ssh.id_ed25519".path;
type = "ed25519";
}];
clanCore.secrets.openssh = {
secrets."ssh.id_ed25519" = { };
facts."ssh.id_ed25519.pub" = { };
generator.path = [ pkgs.coreutils pkgs.openssh ];
generator.script = ''
ssh-keygen -t ed25519 -N "" -f $secrets/ssh.id_ed25519
mv $secrets/ssh.id_ed25519.pub $facts/ssh.id_ed25519.pub
'';
};
}