lib/neovim-plugin: allow configLocation to be wrapped using mkOrder

This commit is contained in:
Matt Sturgeon 2024-12-14 01:26:45 +00:00
parent c181014422
commit 6a192a8604
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
4 changed files with 41 additions and 4 deletions

View file

@ -58,6 +58,15 @@ in
(maybeApply opts)
(lib.mkIf enabled)
];
mkConfigAt =
loc: def:
let
isOrder = loc._type or null == "order";
withOrder = if isOrder then lib.modules.mkOrder loc.priority else lib.id;
loc' = lib.toList (if isOrder then loc.content else loc);
in
lib.setAttrByPath loc' (withOrder def);
}
// lib.mapAttrs (
name: msg: