Update nixos/modules/services/networking/libreswan.nix

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
Felix Bühler 2023-07-02 19:03:19 +02:00 committed by GitHub
parent 7cc9ced775
commit e770737241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ let
nonchars = filter (x : !(elem x.value chars))
(imap0 (i: v: {ind = i; value = v;}) (stringToCharacters str));
in
lib.optionalString (length nonchars != 0)
lib.optionalString (nonchars != [ ])
(substring (head nonchars).ind (add 1 (sub (last nonchars).ind (head nonchars).ind)) str);
indent = str: concatStrings (concatMap (s: [" " (trim [" " "\t"] s) "\n"]) (splitString "\n" str));
configText = indent (toString cfg.configSetup);