mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 19:21:04 +00:00
nixos/kanidm: allow not setting bindaddress (#353681)
This commit is contained in:
commit
6a9a64bac2
|
@ -198,16 +198,19 @@ let
|
|||
'';
|
||||
|
||||
serverPort =
|
||||
let
|
||||
address = cfg.serverSettings.bindaddress;
|
||||
in
|
||||
# ipv6:
|
||||
if hasInfix "]:" cfg.serverSettings.bindaddress then
|
||||
last (splitString "]:" cfg.serverSettings.bindaddress)
|
||||
if hasInfix "]:" address then
|
||||
last (splitString "]:" address)
|
||||
else
|
||||
# ipv4:
|
||||
if hasInfix "." cfg.serverSettings.bindaddress then
|
||||
last (splitString ":" cfg.serverSettings.bindaddress)
|
||||
if hasInfix "." address then
|
||||
last (splitString ":" address)
|
||||
# default is 8443
|
||||
else
|
||||
"8443";
|
||||
throw "Address not parseable as IPv4 nor IPv6.";
|
||||
in
|
||||
{
|
||||
options.services.kanidm = {
|
||||
|
@ -225,6 +228,7 @@ in
|
|||
bindaddress = mkOption {
|
||||
description = "Address/port combination the webserver binds to.";
|
||||
example = "[::1]:8443";
|
||||
default = "127.0.0.1:8443";
|
||||
type = types.str;
|
||||
};
|
||||
# Should be optional but toml does not accept null
|
||||
|
|
Loading…
Reference in a new issue