mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
Set forgejo ssh port with an option
This commit is contained in:
parent
af3d333395
commit
3d4c301bd8
1 changed files with 14 additions and 2 deletions
|
|
@ -1,10 +1,22 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.custom.services.forgejo.ssh;
|
||||
in
|
||||
{
|
||||
options.custom.services.forgejo.ssh.enable = lib.mkEnableOption "";
|
||||
options.custom.services.forgejo.ssh = {
|
||||
enable = lib.mkEnableOption "";
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 22;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.forgejo.settings.server.SSH_PORT = cfg.port;
|
||||
|
||||
config = lib.mkIf config.custom.services.forgejo.ssh.enable {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = lib.mkForce [ cfg.port ];
|
||||
authorizedKeysFiles = lib.mkForce [ "${config.services.forgejo.stateDir}/.ssh/authorized_keys" ];
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue