kresd.nix: fix string escaping
\+ has no effect in single quoted strings
This commit is contained in:
parent
1811a07daa
commit
0c8f5c0f15
@ -8,9 +8,9 @@ let
|
|||||||
# Convert systemd-style address specification to kresd config line(s).
|
# Convert systemd-style address specification to kresd config line(s).
|
||||||
# On Nix level we don't attempt to precisely validate the address specifications.
|
# On Nix level we don't attempt to precisely validate the address specifications.
|
||||||
mkListen = kind: addr: let
|
mkListen = kind: addr: let
|
||||||
al_v4 = builtins.match "([0-9.]\+):([0-9]\+)" addr;
|
al_v4 = builtins.match "([0-9.]+):([0-9]+)" addr;
|
||||||
al_v6 = builtins.match "\\[(.\+)]:([0-9]\+)" addr;
|
al_v6 = builtins.match "\\[(.+)]:([0-9]+)" addr;
|
||||||
al_portOnly = builtins.match "()([0-9]\+)" addr;
|
al_portOnly = builtins.match "()([0-9]+)" addr;
|
||||||
al = findFirst (a: a != null)
|
al = findFirst (a: a != null)
|
||||||
(throw "services.kresd.*: incorrect address specification '${addr}'")
|
(throw "services.kresd.*: incorrect address specification '${addr}'")
|
||||||
[ al_v4 al_v6 al_portOnly ];
|
[ al_v4 al_v6 al_portOnly ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user