diff options
Diffstat (limited to 'pkgs/lib/types.nix')
-rw-r--r-- | pkgs/lib/types.nix | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix index 1cb1185b8bb..6ddac61d91b 100644 --- a/pkgs/lib/types.nix +++ b/pkgs/lib/types.nix @@ -68,6 +68,14 @@ rec { merge = lib.concatStrings; }; + # Like ‘string’, but add newlines between every value. Useful for + # configuration file contents. + lines = mkOptionType { + name = "string"; + check = lib.traceValIfNot builtins.isString; + merge = lib.concatStringsSep "\n"; + }; + envVar = mkOptionType { name = "environment variable"; inherit (string) check; |