Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions modules/services/unison.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -36,6 +36,8 @@ let
Additional command line options as a dictionary to pass to the
<literal>unison</literal> program.
</para><para>
Use a list of strings to declare the same option multiple times.
</para><para>
See
<citerefentry>
<refentrytitle>unison</refentrytitle>
Expand All @@ -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);

Expand Down