Kaynağa Gözat

refactor: moving the `tmux-select-pane-no-wrap` plugin into `tmuxPlugins`

Zander Hawke 11 ay önce
ebeveyn
işleme
1c0c3013f0

+ 1 - 1
home/features/cli/tmux.nix

@@ -22,7 +22,7 @@
     terminal = "tmux-256color";
 
     plugins = with pkgs.tmuxPlugins; [
-      pkgs.more-tmux-plugins.tmux-select-pane-no-wrap
+      tmux-select-pane-no-wrap
       {
         plugin = catppuccin;
         extraConfig = ''

+ 3 - 3
packages/default.nix

@@ -2,9 +2,9 @@
   pkgs ? (import <nixpkgs>) { },
 }:
 {
-  # ghostty = pkgs.callPackage ./ghostty/package.nix {};
   hello = pkgs.callPackage ./hello.nix { };
   photo-cli = pkgs.callPackage ./photo-cli.nix { };
-  zen-browser = pkgs.callPackage ./zen-browser { };
-  more-tmux-plugins = pkgs.callPackage ./more-tmux-plugins.nix { };
+  tmuxPlugins = pkgs.tmuxPlugins // {
+    tmux-select-pane-no-wrap = pkgs.callPackage ./tmux-select-pane-no-wrap.nix { };
+  };
 }

+ 0 - 86
packages/more-tmux-plugins.nix

@@ -1,86 +0,0 @@
-{
-  lib,
-  fetchFromGitHub,
-  pkgs,
-  stdenv,
-  config,
-}:
-
-let
-  rtpPath = "share/tmux-plugins";
-
-  addRtp =
-    path: rtpFilePath: attrs: derivation:
-    derivation
-    // {
-      rtp = "${derivation}/${path}/${rtpFilePath}";
-    }
-    // {
-      overrideAttrs = f: mkTmuxPlugin (attrs // f attrs);
-    };
-
-  mkTmuxPlugin =
-    a@{
-      pluginName,
-      rtpFilePath ? (builtins.replaceStrings [ "-" ] [ "_" ] pluginName) + ".tmux",
-      namePrefix ? "tmuxplugin-",
-      src,
-      unpackPhase ? "",
-      configurePhase ? ":",
-      buildPhase ? ":",
-      addonInfo ? null,
-      preInstall ? "",
-      postInstall ? "",
-      path ? lib.getName pluginName,
-      ...
-    }:
-    if lib.hasAttr "dependencies" a then
-      throw "dependencies attribute is obselete. see NixOS/nixpkgs#118034" # added 2021-04-01
-    else
-      addRtp "${rtpPath}/${path}" rtpFilePath a (
-        stdenv.mkDerivation (
-          a
-          // {
-            pname = namePrefix + pluginName;
-
-            inherit
-              pluginName
-              unpackPhase
-              configurePhase
-              buildPhase
-              addonInfo
-              preInstall
-              postInstall
-              ;
-
-            installPhase = ''
-              runHook preInstall
-
-              target=$out/${rtpPath}/${path}
-              mkdir -p $out/${rtpPath}
-              cp -r . $target
-              if [ -n "$addonInfo" ]; then
-                echo "$addonInfo" > $target/addon-info.json
-              fi
-
-              runHook postInstall
-            '';
-          }
-        )
-      );
-
-in
-rec {
-  inherit mkTmuxPlugin;
-
-  tmux-select-pane-no-wrap = mkTmuxPlugin rec {
-    pluginName = "tmux-select-pane-no-wrap";
-    version = "00add78";
-    src = fetchFromGitHub {
-      owner = "dalejung";
-      repo = pluginName;
-      rev = version;
-      sha256 = "sha256-ot0cHvk1TXvHOw9z+7TLSiHT77jHwvV2PSHcNuhOorQ=";
-    };
-  };
-}

+ 11 - 0
packages/tmux-select-pane-no-wrap.nix

@@ -0,0 +1,11 @@
+{ fetchFromGitHub, tmuxPlugins }:
+tmuxPlugins.mkTmuxPlugin rec {
+  pluginName = "tmux-select-pane-no-wrap";
+  version = "00add78";
+  src = fetchFromGitHub {
+    owner = "dalejung";
+    repo = pluginName;
+    rev = version;
+    sha256 = "sha256-ot0cHvk1TXvHOw9z+7TLSiHT77jHwvV2PSHcNuhOorQ=";
+  };
+}