Move web-service-modules into a separate directory

This commit is contained in:
SebastianStork 2025-10-11 15:36:21 +02:00
parent 52c510d612
commit b2680db359
18 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,31 @@
{ config, lib, ... }:
let
cfg = config.custom.services.forgejo.ssh;
in
{
options.custom.services.forgejo.ssh = {
enable = lib.mkEnableOption "";
port = lib.mkOption {
type = lib.types.port;
default = 22;
};
};
config = lib.mkIf cfg.enable {
meta.ports.tcp.list = [ cfg.port ];
services.forgejo.settings.server.SSH_PORT = cfg.port;
services.openssh = {
enable = true;
ports = lib.mkForce [ cfg.port ];
authorizedKeysFiles = lib.mkForce [ "${config.services.forgejo.stateDir}/.ssh/authorized_keys" ];
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
AllowUsers = [ config.services.forgejo.user ];
};
};
};
}