nixos/gitea: add ssh options
This commit is contained in:
parent
dfd32f11f3
commit
6c258a7c21
1 changed files with 26 additions and 0 deletions
|
@ -170,6 +170,25 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ssh = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Enable external SSH feature.";
|
||||||
|
};
|
||||||
|
|
||||||
|
clonePort = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 22;
|
||||||
|
example = 2222;
|
||||||
|
description = ''
|
||||||
|
SSH port displayed in clone URL.
|
||||||
|
The option is required to configure a service when the external visible port
|
||||||
|
differs from the local listening port i.e. if port forwarding is used.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
appName = mkOption {
|
appName = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "gitea: Gitea Service";
|
default = "gitea: Gitea Service";
|
||||||
|
@ -327,6 +346,13 @@ in
|
||||||
HTTP_ADDR = cfg.httpAddress;
|
HTTP_ADDR = cfg.httpAddress;
|
||||||
HTTP_PORT = cfg.httpPort;
|
HTTP_PORT = cfg.httpPort;
|
||||||
})
|
})
|
||||||
|
(mkIf cfg.ssh.enable {
|
||||||
|
DISABLE_SSH = false;
|
||||||
|
SSH_PORT = cfg.ssh.clonePort;
|
||||||
|
})
|
||||||
|
(mkIf (!cfg.ssh.enable) {
|
||||||
|
DISABLE_SSH = true;
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
session = {
|
session = {
|
||||||
|
|
Loading…
Reference in a new issue