diff --git a/modules/services/unison.nix b/modules/services/unison.nix
index d7f8a628a..e32f70522 100644
--- a/modules/services/unison.nix
+++ b/modules/services/unison.nix
@@ -22,7 +22,7 @@ let
};
commandOptions = mkOption rec {
- type = with types; attrsOf str;
+ type = with types; attrsOf (either str (listOf str));
apply = mergeAttrs default;
default = {
repeat = "watch";
@@ -36,6 +36,8 @@ let
Additional command line options as a dictionary to pass to the
unison program.
+ Use a list of strings to declare the same option multiple times.
+
See
unison
@@ -60,7 +62,9 @@ let
};
};
- serialiseArg = key: val: escapeShellArg "-${key}=${escape [ "=" ] val}";
+ serialiseArg = key: val:
+ concatStringsSep " "
+ (forEach (toList val) (x: escapeShellArg "-${key}=${escape [ "=" ] x}"));
serialiseArgs = args: concatStringsSep " " (mapAttrsToList serialiseArg args);