mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 01:19:32 +08:00
Yazi is deprecating init.lua for main.lua usages. This adds support for
main.lua in plugins.
(cherry picked from commit 18fa9f323d)
This commit is contained in:
@@ -265,8 +265,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}
|
||||
@@ -281,6 +285,6 @@ in {
|
||||
"preview.png"
|
||||
"LICENSE"
|
||||
"LICENSE-tmtheme"
|
||||
]) ++ (mkAsserts "plugins" [ "init.lua" ]);
|
||||
]) ++ (mkAsserts "plugins" [ "init.lua" "main.lua" ]);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user