mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-14 23:27:47 +00:00
calibre-server: add extraFlags and openFirewall options
This allows users to pass extra flags to the calibre-server command and open the necessary ports in the firewall for the Calibre Server API.
This commit is contained in:
parent
474d515b26
commit
b6b90562f7
@ -12,7 +12,7 @@ let
|
||||
"--port" = cfg.port;
|
||||
"--auth-mode" = cfg.auth.mode;
|
||||
"--userdb" = cfg.auth.userDb;
|
||||
}) ++ [(lib.optionalString (cfg.auth.enable == true) "--enable-auth")])
|
||||
}) ++ [ (lib.optionalString (cfg.auth.enable == true) "--enable-auth") ] ++ cfg.extraFlags)
|
||||
);
|
||||
in
|
||||
|
||||
@ -42,6 +42,15 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
extraFlags = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra flags to pass to the calibre-server command.
|
||||
See the [calibre-server documentation](${generatedDocumentationLink}) for details.
|
||||
'';
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "calibre-server";
|
||||
@ -73,6 +82,13 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
openFirewall = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description =
|
||||
"Open ports in the firewall for the Calibre Server web interface.";
|
||||
};
|
||||
|
||||
auth = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
@ -137,6 +153,9 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall =
|
||||
lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.port ]; };
|
||||
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ gaelreyrol ];
|
||||
|
Loading…
Reference in New Issue
Block a user