Enable forgejo ssh server

This commit is contained in:
SebastianStork 2025-06-01 21:57:40 +02:00
parent 671ddf8233
commit cb6570667b
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,18 @@
{ config, lib, ... }:
{
options.custom.services.forgejo.ssh.enable = lib.mkEnableOption "";
config = lib.mkIf config.custom.services.forgejo.ssh.enable {
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
AllowUsers = [ config.users.users.forgejo.name ];
# https://forgejo.org/docs/latest/admin/recommendations/#git-over-ssh
AcceptEnv = "GIT_PROTOCOL";
};
};
};
}