From 834ae553534b6e98aca3e78615b7cf93c67fd259 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Tue, 8 Apr 2025 17:47:11 -0500 Subject: [PATCH] yaziPlugins: use a helper function for creating derivations --- .../ya/yazi/plugins/bypass/default.nix | 12 +---- .../by-name/ya/yazi/plugins/chmod/default.nix | 16 +----- pkgs/by-name/ya/yazi/plugins/default.nix | 54 ++++++++++++++++++- pkgs/by-name/ya/yazi/plugins/diff/default.nix | 16 +----- .../ya/yazi/plugins/full-border/default.nix | 16 +----- pkgs/by-name/ya/yazi/plugins/git/default.nix | 16 +----- pkgs/by-name/ya/yazi/plugins/glow/default.nix | 12 +---- .../ya/yazi/plugins/jump-to-char/default.nix | 16 +----- pkgs/by-name/ya/yazi/plugins/lsar/default.nix | 16 +----- .../ya/yazi/plugins/mactag/default.nix | 16 +----- .../ya/yazi/plugins/mediainfo/default.nix | 12 +---- .../ya/yazi/plugins/miller/default.nix | 12 +---- .../ya/yazi/plugins/mime-ext/default.nix | 16 +----- .../by-name/ya/yazi/plugins/mount/default.nix | 16 +----- .../ya/yazi/plugins/no-status/default.nix | 16 +----- pkgs/by-name/ya/yazi/plugins/ouch/default.nix | 12 +---- .../yazi/plugins/relative-motions/default.nix | 12 +---- .../ya/yazi/plugins/restore/default.nix | 12 +---- .../ya/yazi/plugins/smart-enter/default.nix | 16 +----- .../ya/yazi/plugins/smart-filter/default.nix | 16 +----- .../ya/yazi/plugins/starship/default.nix | 12 +---- pkgs/by-name/ya/yazi/plugins/sudo/default.nix | 12 +---- .../ya/yazi/plugins/toggle-pane/default.nix | 16 +----- .../ya/yazi/plugins/vcs-files/default.nix | 16 +----- 24 files changed, 98 insertions(+), 288 deletions(-) diff --git a/pkgs/by-name/ya/yazi/plugins/bypass/default.nix b/pkgs/by-name/ya/yazi/plugins/bypass/default.nix index 66f1a52e0d93..e04999b8262c 100644 --- a/pkgs/by-name/ya/yazi/plugins/bypass/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/bypass/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "bypass.yazi"; version = "0-unstable-2025-02-16"; @@ -14,14 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-XXp4XflrVrs8FrUCRUbSxWZTSGPrIGrpqvB1pARerKQ="; }; - installPhase = '' - runHook preInstall - - cp -r . $out - - runHook postInstall - ''; - meta = { description = "Yazi plugin for skipping directories with only a single sub-directory."; homepage = "https://github.com/Rolv-Apneseth/bypass.yazi"; diff --git a/pkgs/by-name/ya/yazi/plugins/chmod/default.nix b/pkgs/by-name/ya/yazi/plugins/chmod/default.nix index 231f7d558613..ea34d479322e 100644 --- a/pkgs/by-name/ya/yazi/plugins/chmod/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/chmod/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "chmod.yazi"; version = "25.2.26-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r chmod.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Execute chmod on the selected files to change their mode"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/default.nix b/pkgs/by-name/ya/yazi/plugins/default.nix index 80905a62b24a..6fbde69e2b1b 100644 --- a/pkgs/by-name/ya/yazi/plugins/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/default.nix @@ -1,10 +1,60 @@ -{ lib, callPackage }: +{ + lib, + callPackage, + stdenvNoCC, +}: let root = ./.; - call = name: callPackage (root + "/${name}") { }; + + mkYaziPlugin = + args@{ + pname, + src, + meta ? { }, + installPhase ? null, + ... + }: + stdenvNoCC.mkDerivation ( + args + // { + installPhase = + if installPhase != null then + installPhase + else if (src ? owner && src.owner == "yazi-rs") then + # NOTE: License is a relative symbolic link + # We remove the link and copy the true license + '' + runHook preInstall + + cp -r ${pname} $out + rm $out/LICENSE + cp LICENSE $out + + runHook postInstall + '' + else + # Normal plugins don't require special installation other than to copy their contents. + '' + runHook preInstall + + cp -r . $out + + runHook postInstall + ''; + meta = meta // { + description = meta.description or ""; + platforms = meta.platforms or lib.platforms.all; + }; + } + ); + + call = name: callPackage (root + "/${name}") { inherit mkYaziPlugin; }; in lib.pipe root [ builtins.readDir (lib.filterAttrs (_: type: type == "directory")) (builtins.mapAttrs (name: _: call name)) ] +// { + inherit mkYaziPlugin; +} diff --git a/pkgs/by-name/ya/yazi/plugins/diff/default.nix b/pkgs/by-name/ya/yazi/plugins/diff/default.nix index 6645b5e00c3f..f8500fc742c1 100644 --- a/pkgs/by-name/ya/yazi/plugins/diff/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/diff/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "diff.yazi"; version = "25.2.7-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r diff.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Diff the selected file with the hovered file, create a living patch, and copy it to the clipboard"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/full-border/default.nix b/pkgs/by-name/ya/yazi/plugins/full-border/default.nix index 41aa381a49e6..90bbaf5f64ec 100644 --- a/pkgs/by-name/ya/yazi/plugins/full-border/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/full-border/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "full-border.yazi"; version = "25.2.26-unstable-2025-03-11"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-mqo71VLZsHmgTybxgqKNo9F2QeMuCSvZ89uen1VbWb4="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r full-border.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Add a full border to Yazi to make it look fancier"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/git/default.nix b/pkgs/by-name/ya/yazi/plugins/git/default.nix index bf6f8b7f9720..f7ded87a9bee 100644 --- a/pkgs/by-name/ya/yazi/plugins/git/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/git/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "git.yazi"; version = "25.2.26-unstable-2025-03-17"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-ZLL/dFjNsryjm51kFNOmw5DhSGl2K5IfatHpe1PkuFE="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r git.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Show the status of Git file changes as linemode in the file list"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/glow/default.nix b/pkgs/by-name/ya/yazi/plugins/glow/default.nix index b97cda4a4937..b37e7481151c 100644 --- a/pkgs/by-name/ya/yazi/plugins/glow/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/glow/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "glow.yazi"; version = "0-unstable-2025-02-22"; @@ -14,14 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-DPud1Mfagl2z490f5L69ZPnZmVCa0ROXtFeDbEegBBU="; }; - installPhase = '' - runHook preInstall - - cp -r . $out - - runHook postInstall - ''; - meta = { description = "Glow preview plugin for yazi."; homepage = "https://github.com/Reledia/glow.yazi"; diff --git a/pkgs/by-name/ya/yazi/plugins/jump-to-char/default.nix b/pkgs/by-name/ya/yazi/plugins/jump-to-char/default.nix index fa7ce86bad4e..55269a5e7b04 100644 --- a/pkgs/by-name/ya/yazi/plugins/jump-to-char/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/jump-to-char/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "jump-to-char.yazi"; version = "25.2.26-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r jump-to-char.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Switch the preview pane between hidden and shown"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/lsar/default.nix b/pkgs/by-name/ya/yazi/plugins/lsar/default.nix index 39485e605314..95dbfcdf8aa1 100644 --- a/pkgs/by-name/ya/yazi/plugins/lsar/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/lsar/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "lsar.yazi"; version = "25.2.26-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r lsar.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Previewing archive contents with lsar"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/mactag/default.nix b/pkgs/by-name/ya/yazi/plugins/mactag/default.nix index 47c34d646ae0..37e45598a26e 100644 --- a/pkgs/by-name/ya/yazi/plugins/mactag/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/mactag/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "mactag.yazi"; version = "25.2.26-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r mactag.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Previewing archive contents with mactag"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/mediainfo/default.nix b/pkgs/by-name/ya/yazi/plugins/mediainfo/default.nix index ffcbd12286be..a1612b59e64a 100644 --- a/pkgs/by-name/ya/yazi/plugins/mediainfo/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/mediainfo/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "mediainfo.yazi"; version = "25.2.7-unstable-2025-04-05"; @@ -14,14 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-oFp8mJ62FsJX46mKQ7/o6qXPC9qx3+oSfqS0cKUZETI="; }; - installPhase = '' - runHook preInstall - - cp -r . $out - - runHook postInstall - ''; - meta = { description = "Yazi plugin for previewing media files."; homepage = "https://github.com/boydaihungst/mediainfo.yazi"; diff --git a/pkgs/by-name/ya/yazi/plugins/miller/default.nix b/pkgs/by-name/ya/yazi/plugins/miller/default.nix index c83f51648c1d..abc48218c54f 100644 --- a/pkgs/by-name/ya/yazi/plugins/miller/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/miller/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "miller.yazi"; version = "0-unstable-2024-08-28"; @@ -14,14 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-GXZZ/vI52rSw573hoMmspnuzFoBXDLcA0fqjF76CdnY="; }; - installPhase = '' - runHook preInstall - - cp -r . $out - - runHook postInstall - ''; - meta = { description = "Miller, now in yazi."; homepage = "https://github.com/Reledia/miller.yazi"; diff --git a/pkgs/by-name/ya/yazi/plugins/mime-ext/default.nix b/pkgs/by-name/ya/yazi/plugins/mime-ext/default.nix index 44fd81b9a273..7aa72cba4817 100644 --- a/pkgs/by-name/ya/yazi/plugins/mime-ext/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/mime-ext/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "mime-ext.yazi"; version = "25.2.26-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r mime-ext.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Previewing archive contents with mime-ext"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/mount/default.nix b/pkgs/by-name/ya/yazi/plugins/mount/default.nix index 84b548f611b0..062c728c49bd 100644 --- a/pkgs/by-name/ya/yazi/plugins/mount/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/mount/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "mount.yazi"; version = "25.2.26-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r mount.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Previewing archive contents with mount"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/no-status/default.nix b/pkgs/by-name/ya/yazi/plugins/no-status/default.nix index e67d2670bafb..bf66c5235d47 100644 --- a/pkgs/by-name/ya/yazi/plugins/no-status/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/no-status/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "no-status.yazi"; version = "25.2.7-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r no-status.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Previewing archive contents with no-status"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/ouch/default.nix b/pkgs/by-name/ya/yazi/plugins/ouch/default.nix index 926bb72682cd..2a6fa7c70853 100644 --- a/pkgs/by-name/ya/yazi/plugins/ouch/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/ouch/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "ouch.yazi"; version = "0-unstable-2025-03-29"; @@ -14,14 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-7X8uAiJ8vBXYBXOgyKhVVikOnTBGrdCcXOJemjQNolI="; }; - installPhase = '' - runHook preInstall - - cp -r . $out - - runHook postInstall - ''; - meta = { description = "A Yazi plugin to preview archives."; homepage = "https://github.com/ndtoan96/ouch.yazi"; diff --git a/pkgs/by-name/ya/yazi/plugins/relative-motions/default.nix b/pkgs/by-name/ya/yazi/plugins/relative-motions/default.nix index 1f1182a5e8f9..1ea04f712255 100644 --- a/pkgs/by-name/ya/yazi/plugins/relative-motions/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/relative-motions/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "relative-motions.yazi"; version = "25.2.7-unstable-2025-04-07"; @@ -14,14 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-L5B5X762rBoxgKrUi0uRLDmAOJ/jPALc2bP9MYLiGYw="; }; - installPhase = '' - runHook preInstall - - cp -r . $out - - runHook postInstall - ''; - meta = { description = "Yazi plugin based about vim motions."; homepage = "https://github.com/dedukun/relative-motions.yazi"; diff --git a/pkgs/by-name/ya/yazi/plugins/restore/default.nix b/pkgs/by-name/ya/yazi/plugins/restore/default.nix index be3bb09d22a8..ec1a45c27a9f 100644 --- a/pkgs/by-name/ya/yazi/plugins/restore/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/restore/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "restore.yazi"; version = "25.2.7-unstable-2025-04-04"; @@ -14,14 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-3Z8P25u9bffdjrPjxLRWUQn6MdBS+vyElUBkgV4EUwY="; }; - installPhase = '' - runHook preInstall - - cp -r . $out - - runHook postInstall - ''; - meta = { description = "Undo/Recover trashed files/folders."; homepage = "https://github.com/boydaihungst/restore.yazi"; diff --git a/pkgs/by-name/ya/yazi/plugins/smart-enter/default.nix b/pkgs/by-name/ya/yazi/plugins/smart-enter/default.nix index 3018b701ad42..7e54ccdd12bf 100644 --- a/pkgs/by-name/ya/yazi/plugins/smart-enter/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/smart-enter/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "smart-enter.yazi"; version = "25.2.26-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r smart-enter.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Previewing archive contents with smart-enter"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/smart-filter/default.nix b/pkgs/by-name/ya/yazi/plugins/smart-filter/default.nix index 21a19ff0d69d..417147a95e70 100644 --- a/pkgs/by-name/ya/yazi/plugins/smart-filter/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/smart-filter/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "smart-filter.yazi"; version = "25.2.26-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-nZ8yfnKvNLM5aA+mmQ3PkfM5lwSKwWnkQewcg9GwseI="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r smart-filter.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Previewing archive contents with smart-filter"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/starship/default.nix b/pkgs/by-name/ya/yazi/plugins/starship/default.nix index b24020a6ed1c..5d7394d9c9a9 100644 --- a/pkgs/by-name/ya/yazi/plugins/starship/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/starship/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "starship.yazi"; version = "25.2.7-unstable-2025-02-23"; @@ -14,14 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-bhLUziCDnF4QDCyysRn7Az35RAy8ibZIVUzoPgyEO1A="; }; - installPhase = '' - runHook preInstall - - cp -r . $out - - runHook postInstall - ''; - meta = { description = "Starship prompt plugin for yazi."; homepage = "https://github.com/Rolv-Apneseth/starship.yazi"; diff --git a/pkgs/by-name/ya/yazi/plugins/sudo/default.nix b/pkgs/by-name/ya/yazi/plugins/sudo/default.nix index be514225279b..94a6d3538431 100644 --- a/pkgs/by-name/ya/yazi/plugins/sudo/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/sudo/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "sudo.yazi"; version = "0-unstable-2025-02-08"; @@ -14,14 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-IvTBAhZrbrNJ5nsLxr35V0ntQw89yXUdoU9ashbflYY="; }; - installPhase = '' - runHook preInstall - - cp -r . $out - - runHook postInstall - ''; - meta = { description = "Call `sudo` in yazi."; homepage = "https://github.com/TD-Sky/sudo.yazi"; diff --git a/pkgs/by-name/ya/yazi/plugins/toggle-pane/default.nix b/pkgs/by-name/ya/yazi/plugins/toggle-pane/default.nix index 12a98bf119ae..a77ea05970eb 100644 --- a/pkgs/by-name/ya/yazi/plugins/toggle-pane/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/toggle-pane/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "toggle-pane.yazi"; version = "25.2.26-unstable-2025-03-02"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-80mR86UWgD11XuzpVNn56fmGRkvj0af2cFaZkU8M31I="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r toggle-pane.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Previewing archive contents with toggle-pane"; homepage = "https://yazi-rs.github.io"; diff --git a/pkgs/by-name/ya/yazi/plugins/vcs-files/default.nix b/pkgs/by-name/ya/yazi/plugins/vcs-files/default.nix index 80364c0615f7..f83d4d766a21 100644 --- a/pkgs/by-name/ya/yazi/plugins/vcs-files/default.nix +++ b/pkgs/by-name/ya/yazi/plugins/vcs-files/default.nix @@ -1,9 +1,9 @@ { lib, - stdenvNoCC, fetchFromGitHub, + mkYaziPlugin, }: -stdenvNoCC.mkDerivation { +mkYaziPlugin { pname = "vcs-files.yazi"; version = "25.3.7-unstable-2025-03-07"; @@ -14,18 +14,6 @@ stdenvNoCC.mkDerivation { hash = "sha256-80mR86UWgD11XuzpVNn56fmGRkvj0af2cFaZkU8M31I="; }; - # NOTE: License is a relative symbolic link - # We remove the link and copy the true license - installPhase = '' - runHook preInstall - - cp -r vcs-files.yazi $out - rm $out/LICENSE - cp LICENSE $out - - runHook postInstall - ''; - meta = { description = "Previewing archive contents with vcs-files"; homepage = "https://yazi-rs.github.io";