| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- {
- 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=";
- };
- };
- }
|