mirror of
https://git.sr.ht/~roxwize/.dotfiles
synced 2025-05-07 22:23:07 +00:00
~
This commit is contained in:
parent
9e407cd78f
commit
fe52c9c97c
6 changed files with 170 additions and 2 deletions
|
@ -7,6 +7,14 @@ in with lib; {
|
|||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
listenPortHTTP = mkOption {
|
||||
type = types.int;
|
||||
default = 80;
|
||||
};
|
||||
listenPortHTTPS = mkOption {
|
||||
type = types.int;
|
||||
default = 443;
|
||||
};
|
||||
api-password = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
|
@ -21,10 +29,14 @@ in with lib; {
|
|||
TZ = config.time.timeZone;
|
||||
FTLCONF_webserver_api_password = mkIf (cfg.api-password != "") cfg.api-password;
|
||||
};
|
||||
ports = [
|
||||
(builtins.toString cfg.listenPortHTTP + ":80")
|
||||
(builtins.toString cfg.listenPortHTTPS + ":443")
|
||||
];
|
||||
};
|
||||
|
||||
networking.firewall = mkIf cfg.openFirewall {
|
||||
allowedTCPPorts = [ 53 80 443 ];
|
||||
allowedTCPPorts = [ 53 cfg.listenPortHTTP cfg.listenPortHTTPS ];
|
||||
};
|
||||
}
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue