Skip to content

Commit

Permalink
tmuxPlugins: expose mkDerivation for creating a TMUX plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
kalbasit committed Aug 6, 2018
1 parent b234f07 commit e8a5f6c
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions pkgs/misc/tmux-plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ let

addRtp = path: rtpFilePath: attrs: derivation:
derivation // { rtp = "${derivation}/${path}/${rtpFilePath}"; } // {
overrideAttrs = f: buildTmuxPlugin (attrs // f attrs);
overrideAttrs = f: mkDerivation (attrs // f attrs);
};

buildTmuxPlugin = a@{
mkDerivation = a@{
pluginName,
rtpFilePath ? (builtins.replaceStrings ["-"] ["_"] pluginName) + ".tmux",
namePrefix ? "tmuxplugin-",
src,
unpackPhase ? "",
configurePhase ? "",
buildPhase ? "",
configurePhase ? ":",
buildPhase ? ":",
addonInfo ? null,
preInstall ? "",
postInstall ? "",
Expand Down Expand Up @@ -44,14 +44,11 @@ let
dependencies = [ pkgs.bash ] ++ dependencies;
}));

buildTmuxPluginFrom2Nix = a: buildTmuxPlugin ({
buildPhase = ":";
configurePhase =":";
} // a);

in rec {

battery = buildTmuxPluginFrom2Nix {
inherit mkDerivation;

battery = mkDerivation {
pluginName = "battery";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-battery";
Expand All @@ -60,7 +57,7 @@ in rec {
};
};

continuum = buildTmuxPluginFrom2Nix {
continuum = mkDerivation {
pluginName = "continuum";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-continuum";
Expand All @@ -70,7 +67,7 @@ in rec {
dependencies = [ resurrect ];
};

copycat = buildTmuxPluginFrom2Nix {
copycat = mkDerivation {
pluginName = "copycat";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-copycat";
Expand All @@ -79,7 +76,7 @@ in rec {
};
};

cpu = buildTmuxPluginFrom2Nix {
cpu = mkDerivation {
pluginName = "cpu";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-cpu";
Expand All @@ -88,7 +85,7 @@ in rec {
};
};

fpp = buildTmuxPluginFrom2Nix {
fpp = mkDerivation {
pluginName = "fpp";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-fpp";
Expand All @@ -101,7 +98,7 @@ in rec {
dependencies = [ pkgs.fpp ];
};

fzf-tmux-url = buildTmuxPluginFrom2Nix {
fzf-tmux-url = mkDerivation {
pluginName = "fzf-tmux-url";
rtpFilePath = "fzf-url.tmux";
src = fetchgit {
Expand All @@ -111,7 +108,7 @@ in rec {
};
};

logging = buildTmuxPluginFrom2Nix {
logging = mkDerivation {
pluginName = "logging";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-logging";
Expand All @@ -120,7 +117,7 @@ in rec {
};
};

net-speed = buildTmuxPluginFrom2Nix {
net-speed = mkDerivation {
pluginName = "net-speed";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-net-speed";
Expand All @@ -129,7 +126,7 @@ in rec {
};
};

maildir-counter = buildTmuxPluginFrom2Nix {
maildir-counter = mkDerivation {
pluginName = "maildir-counter";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-maildir-counter";
Expand All @@ -138,7 +135,7 @@ in rec {
};
};

online-status = buildTmuxPluginFrom2Nix {
online-status = mkDerivation {
pluginName = "online-status";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-online-status";
Expand All @@ -147,7 +144,7 @@ in rec {
};
};

open = buildTmuxPluginFrom2Nix {
open = mkDerivation {
pluginName = "open";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-open";
Expand All @@ -156,7 +153,7 @@ in rec {
};
};

pain-control = buildTmuxPluginFrom2Nix {
pain-control = mkDerivation {
pluginName = "pain-control";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-pain-control";
Expand All @@ -165,7 +162,7 @@ in rec {
};
};

prefix-highlight = buildTmuxPluginFrom2Nix {
prefix-highlight = mkDerivation {
pluginName = "prefix-highlight";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-prefix-highlight";
Expand All @@ -174,7 +171,7 @@ in rec {
};
};

resurrect = buildTmuxPluginFrom2Nix {
resurrect = mkDerivation {
pluginName = "resurrect";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-resurrect";
Expand All @@ -183,7 +180,7 @@ in rec {
};
};

sensible = buildTmuxPluginFrom2Nix {
sensible = mkDerivation {
pluginName = "sensible";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-sensible";
Expand All @@ -192,7 +189,7 @@ in rec {
};
};

sessionist = buildTmuxPluginFrom2Nix {
sessionist = mkDerivation {
pluginName = "sessionist";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-sessionist";
Expand All @@ -201,7 +198,7 @@ in rec {
};
};

sidebar = buildTmuxPluginFrom2Nix {
sidebar = mkDerivation {
pluginName = "sidebar";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-sidebar";
Expand All @@ -210,7 +207,7 @@ in rec {
};
};

urlview = buildTmuxPluginFrom2Nix {
urlview = mkDerivation {
pluginName = "urlview";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-urlview";
Expand All @@ -223,7 +220,7 @@ in rec {
dependencies = [ pkgs.urlview ];
};

yank = buildTmuxPluginFrom2Nix {
yank = mkDerivation {
pluginName = "yank";
src = fetchgit {
url = "https://github.com/tmux-plugins/tmux-yank";
Expand Down

0 comments on commit e8a5f6c

Please sign in to comment.