mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
Merge pull request #290946 from ju1m/systemd-option-list
nixos/systemd: merge unit options as lists when at least one value is a list
This commit is contained in:
commit
f5622df470
5 changed files with 51 additions and 8 deletions
|
@ -21,14 +21,8 @@ in rec {
|
|||
let
|
||||
defs' = filterOverrides defs;
|
||||
in
|
||||
if isList (head defs').value
|
||||
then concatMap (def:
|
||||
if builtins.typeOf def.value == "list"
|
||||
then def.value
|
||||
else
|
||||
throw "The definitions for systemd unit options should be either all lists, representing repeatable options, or all non-lists, but for the option ${showOption loc}, the definitions are a mix of list and non-list ${lib.options.showDefs defs'}"
|
||||
) defs'
|
||||
|
||||
if any (def: isList def.value) defs'
|
||||
then concatMap (def: toList def.value) defs'
|
||||
else mergeEqualOption loc defs';
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue