mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-09 10:16:55 +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
|
toString missingFiles
|
||||||
}";
|
}";
|
||||||
singularOpt = removeSuffix "s" opt;
|
singularOpt = removeSuffix "s" opt;
|
||||||
|
isPluginValid = opt == "plugins"
|
||||||
|
&& (any (file: pathExists "${value}/${file}") requiredFiles);
|
||||||
|
isValid =
|
||||||
|
if opt == "plugins" then isPluginValid else missingFiles == [ ];
|
||||||
in {
|
in {
|
||||||
assertion = isDir && missingFiles == [ ];
|
assertion = isDir && isValid;
|
||||||
message = ''
|
message = ''
|
||||||
Value at `programs.yazi.${opt}.${name}` is not a valid yazi ${singularOpt}.
|
Value at `programs.yazi.${opt}.${name}` is not a valid yazi ${singularOpt}.
|
||||||
${msgNotDir}
|
${msgNotDir}
|
||||||
|
@ -279,6 +283,6 @@ in {
|
||||||
"preview.png"
|
"preview.png"
|
||||||
"LICENSE"
|
"LICENSE"
|
||||||
"LICENSE-tmtheme"
|
"LICENSE-tmtheme"
|
||||||
]) ++ (mkAsserts "plugins" [ "init.lua" ]);
|
]) ++ (mkAsserts "plugins" [ "init.lua" "main.lua" ]);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue