|
|
@@ -1,54 +1,76 @@
|
|
|
-{ lib
|
|
|
-, fetchFromGitHub
|
|
|
-, pkgs
|
|
|
-, stdenv
|
|
|
-, config
|
|
|
+{
|
|
|
+ lib,
|
|
|
+ fetchFromGitHub,
|
|
|
+ pkgs,
|
|
|
+ stdenv,
|
|
|
+ config,
|
|
|
}:
|
|
|
|
|
|
let
|
|
|
rtpPath = "share/tmux-plugins";
|
|
|
|
|
|
- addRtp = path: rtpFilePath: attrs: derivation:
|
|
|
- derivation // { rtp = "${derivation}/${path}/${rtpFilePath}"; } // {
|
|
|
+ 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,
|
|
|
- ...
|
|
|
- }:
|
|
|
+ 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;
|
|
|
+ else
|
|
|
+ addRtp "${rtpPath}/${path}" rtpFilePath a (
|
|
|
+ stdenv.mkDerivation (
|
|
|
+ a
|
|
|
+ // {
|
|
|
+ pname = namePrefix + pluginName;
|
|
|
|
|
|
- inherit pluginName unpackPhase configurePhase buildPhase addonInfo preInstall postInstall;
|
|
|
+ inherit
|
|
|
+ pluginName
|
|
|
+ unpackPhase
|
|
|
+ configurePhase
|
|
|
+ buildPhase
|
|
|
+ addonInfo
|
|
|
+ preInstall
|
|
|
+ postInstall
|
|
|
+ ;
|
|
|
|
|
|
- installPhase = ''
|
|
|
- runHook preInstall
|
|
|
+ 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
|
|
|
+ target=$out/${rtpPath}/${path}
|
|
|
+ mkdir -p $out/${rtpPath}
|
|
|
+ cp -r . $target
|
|
|
+ if [ -n "$addonInfo" ]; then
|
|
|
+ echo "$addonInfo" > $target/addon-info.json
|
|
|
+ fi
|
|
|
|
|
|
- runHook postInstall
|
|
|
- '';
|
|
|
- }));
|
|
|
+ runHook postInstall
|
|
|
+ '';
|
|
|
+ }
|
|
|
+ )
|
|
|
+ );
|
|
|
|
|
|
-in rec {
|
|
|
+in
|
|
|
+rec {
|
|
|
inherit mkTmuxPlugin;
|
|
|
|
|
|
tmux-select-pane-no-wrap = mkTmuxPlugin rec {
|