mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
Merge pull request #158602 from hercules-ci/systemd-unit-mixed-list-error
nixos/systemd: Custom error when mixing list/non-list defs
This commit is contained in:
commit
f5ca531054
1 changed files with 8 additions and 3 deletions
|
@ -20,10 +20,15 @@ in rec {
|
||||||
merge = loc: defs:
|
merge = loc: defs:
|
||||||
let
|
let
|
||||||
defs' = filterOverrides defs;
|
defs' = filterOverrides defs;
|
||||||
defs'' = getValues defs';
|
|
||||||
in
|
in
|
||||||
if isList (head defs'')
|
if isList (head defs').value
|
||||||
then concatLists defs''
|
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'
|
||||||
|
|
||||||
else mergeEqualOption loc defs';
|
else mergeEqualOption loc defs';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue