mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-06 16:57:03 +00:00
yazi: add main.lua support to plugins (#6394)
Yazi is deprecating init.lua for main.lua usages. This adds support for main.lua in plugins.
This commit is contained in:
parent
dae6d3460c
commit
18fa9f323d
1 changed files with 6 additions and 2 deletions
|
@ -263,8 +263,12 @@ in {
|
|||
toString missingFiles
|
||||
}";
|
||||
singularOpt = removeSuffix "s" opt;
|
||||
isPluginValid = opt == "plugins"
|
||||
&& (any (file: pathExists "${value}/${file}") requiredFiles);
|
||||
isValid =
|
||||
if opt == "plugins" then isPluginValid else missingFiles == [ ];
|
||||
in {
|
||||
assertion = isDir && missingFiles == [ ];
|
||||
assertion = isDir && isValid;
|
||||
message = ''
|
||||
Value at `programs.yazi.${opt}.${name}` is not a valid yazi ${singularOpt}.
|
||||
${msgNotDir}
|
||||
|
@ -279,6 +283,6 @@ in {
|
|||
"preview.png"
|
||||
"LICENSE"
|
||||
"LICENSE-tmtheme"
|
||||
]) ++ (mkAsserts "plugins" [ "init.lua" ]);
|
||||
]) ++ (mkAsserts "plugins" [ "init.lua" "main.lua" ]);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue