yazi: append .yazi to plugin folders automatically (#413536)

This commit is contained in:
Austin Horstman 2025-06-03 21:42:24 -05:00 committed by GitHub
commit f67b454f0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View file

@ -76,7 +76,7 @@ in
example = lib.literalExpression ''
{
foo = ./foo;
bar = pkgs.bar;
inherit (pkgs.yaziPlugins) bar;
}
'';
};
@ -97,7 +97,7 @@ in
example = lib.literalExpression ''
{
foo = ./foo;
bar = pkgs.bar;
inherit (pkgs.yaziPlugins) bar;
}
'';
};

View file

@ -69,14 +69,20 @@ let
mkdir $out/plugins
${lib.optionalString (plugins != { }) ''
${lib.concatStringsSep "\n" (
lib.mapAttrsToList (name: value: "ln -s ${value} $out/plugins/${name}") plugins
lib.mapAttrsToList (
name: value:
"ln -s ${value} $out/plugins/${if lib.hasSuffix ".yazi" name then name else "${name}.yazi"}"
) plugins
)}
''}
mkdir $out/flavors
${lib.optionalString (flavors != { }) ''
${lib.concatStringsSep "\n" (
lib.mapAttrsToList (name: value: "ln -s ${value} $out/flavors/${name}") flavors
lib.mapAttrsToList (
name: value:
"ln -s ${value} $out/flavors/${if lib.hasSuffix ".yazi" name then name else "${name}.yazi"}"
) flavors
)}
''}