mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 17:46:29 +09:00
nixos/unitOption: remove unnecessary definition filtering (#412468)
This commit is contained in:
commit
ac5a33bdab
2 changed files with 5 additions and 11 deletions
|
@ -15,7 +15,6 @@ let
|
|||
inherit (lib)
|
||||
any
|
||||
concatMap
|
||||
filterOverrides
|
||||
isList
|
||||
literalExpression
|
||||
mergeEqualOption
|
||||
|
@ -56,13 +55,10 @@ rec {
|
|||
name = "systemd option";
|
||||
merge =
|
||||
loc: defs:
|
||||
let
|
||||
defs' = filterOverrides defs;
|
||||
in
|
||||
if any (def: isList def.value) defs' then
|
||||
concatMap (def: toList def.value) defs'
|
||||
if any (def: isList def.value) defs then
|
||||
concatMap (def: toList def.value) defs
|
||||
else
|
||||
mergeEqualOption loc defs';
|
||||
mergeEqualOption loc defs;
|
||||
};
|
||||
|
||||
sharedOptions = {
|
||||
|
|
|
@ -9,7 +9,7 @@ let
|
|||
checkType = x: lib.isBool x || lib.isString x || lib.isInt x || x == null;
|
||||
in
|
||||
checkType val || (val._type or "" == "override" && checkType val.content);
|
||||
merge = loc: defs: lib.mergeOneOption loc (lib.filterOverrides defs);
|
||||
merge = loc: defs: lib.mergeOneOption loc defs;
|
||||
};
|
||||
|
||||
in
|
||||
|
@ -22,9 +22,7 @@ in
|
|||
type =
|
||||
let
|
||||
highestValueType = lib.types.ints.unsigned // {
|
||||
merge =
|
||||
loc: defs:
|
||||
lib.foldl (a: b: if b.value == null then null else lib.max a b.value) 0 (lib.filterOverrides defs);
|
||||
merge = loc: defs: lib.foldl (a: b: if b.value == null then null else lib.max a b.value) 0 defs;
|
||||
};
|
||||
in
|
||||
lib.types.submodule {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue