From c4f3c2c7428d43ebd5c407a3ec6e834c8697cbd8 Mon Sep 17 00:00:00 2001 From: linsui <36977733+linsui@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:06:16 +0800 Subject: [PATCH] yazi: append .yazi to plugin folders automatically --- nixos/modules/programs/yazi.nix | 4 ++-- pkgs/by-name/ya/yazi/package.nix | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/nixos/modules/programs/yazi.nix b/nixos/modules/programs/yazi.nix index b7e56cf63077..8486cf611c46 100644 --- a/nixos/modules/programs/yazi.nix +++ b/nixos/modules/programs/yazi.nix @@ -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; } ''; }; diff --git a/pkgs/by-name/ya/yazi/package.nix b/pkgs/by-name/ya/yazi/package.nix index 7b45631d0b2d..112147d182b6 100644 --- a/pkgs/by-name/ya/yazi/package.nix +++ b/pkgs/by-name/ya/yazi/package.nix @@ -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 )} ''}