mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31: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, ... }:
|
{ 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 = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
ports = lib.mkForce [ cfg.port ];
|
||||||
authorizedKeysFiles = lib.mkForce [ "${config.services.forgejo.stateDir}/.ssh/authorized_keys" ];
|
authorizedKeysFiles = lib.mkForce [ "${config.services.forgejo.stateDir}/.ssh/authorized_keys" ];
|
||||||
settings = {
|
settings = {
|
||||||
PasswordAuthentication = false;
|
PasswordAuthentication = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue