From daea4b1134f46c39a886143a0cbcb55d95d54529 Mon Sep 17 00:00:00 2001 From: Timothy Stott Date: Wed, 10 Mar 2021 07:32:44 +0000 Subject: [PATCH] tmuxPlugins: rename function to build plugin Make a distinction between stdenv.mkDerivation and the helper function to build the plugin. --- pkgs/misc/tmux-plugins/default.nix | 81 ++++++++++++++---------------- 1 file changed, 38 insertions(+), 43 deletions(-) diff --git a/pkgs/misc/tmux-plugins/default.nix b/pkgs/misc/tmux-plugins/default.nix index 333830f0143e..8cb02185f17d 100644 --- a/pkgs/misc/tmux-plugins/default.nix +++ b/pkgs/misc/tmux-plugins/default.nix @@ -1,7 +1,6 @@ { lib , fetchFromGitHub , pkgs -, reattach-to-user-namespace , stdenv }: @@ -10,10 +9,10 @@ let addRtp = path: rtpFilePath: attrs: derivation: derivation // { rtp = "${derivation}/${path}/${rtpFilePath}"; } // { - overrideAttrs = f: mkDerivation (attrs // f attrs); + overrideAttrs = f: mkTmuxPlugin (attrs // f attrs); }; - mkDerivation = a@{ + mkTmuxPlugin = a@{ pluginName, rtpFilePath ? (builtins.replaceStrings ["-"] ["_"] pluginName) + ".tmux", namePrefix ? "tmuxplugin-", @@ -50,10 +49,7 @@ let })); in rec { - - inherit mkDerivation; - - battery = mkDerivation { + battery = mkTmuxPlugin { pluginName = "battery"; version = "unstable-2019-07-04"; src = fetchFromGitHub { @@ -64,7 +60,7 @@ in rec { }; }; - continuum = mkDerivation { + continuum = mkTmuxPlugin { pluginName = "continuum"; version = "unstable-2020-10-16"; src = fetchFromGitHub { @@ -94,7 +90,7 @@ in rec { }; }; - copycat = mkDerivation { + copycat = mkTmuxPlugin { pluginName = "copycat"; version = "unstable-2020-01-09"; src = fetchFromGitHub { @@ -105,7 +101,7 @@ in rec { }; }; - cpu = mkDerivation { + cpu = mkTmuxPlugin { pluginName = "cpu"; version = "unstable-2020-07-25"; src = fetchFromGitHub { @@ -116,7 +112,7 @@ in rec { }; }; - ctrlw = mkDerivation rec { + ctrlw = mkTmuxPlugin rec { pluginName = "ctrlw"; version = "0.1.1"; src = fetchFromGitHub { @@ -127,7 +123,7 @@ in rec { }; }; - dracula = mkDerivation rec { + dracula = mkTmuxPlugin rec { pluginName = "dracula"; version = "unstable-2021-02-18"; src = fetchFromGitHub { @@ -145,7 +141,7 @@ in rec { }; }; - fingers = mkDerivation rec { + fingers = mkTmuxPlugin rec { pluginName = "fingers"; rtpFilePath = "tmux-fingers.tmux"; version = "1.0.1"; @@ -159,7 +155,7 @@ in rec { dependencies = [ pkgs.gawk ]; }; - fpp = mkDerivation { + fpp = mkTmuxPlugin { pluginName = "fpp"; version = "unstable-2016-03-08"; src = fetchFromGitHub { @@ -174,7 +170,7 @@ in rec { dependencies = [ pkgs.fpp ]; }; - fzf-tmux-url = mkDerivation { + fzf-tmux-url = mkTmuxPlugin { pluginName = "fzf-tmux-url"; rtpFilePath = "fzf-url.tmux"; version = "unstable-2019-12-02"; @@ -186,7 +182,7 @@ in rec { }; }; - gruvbox = mkDerivation { + gruvbox = mkTmuxPlugin { pluginName = "gruvbox"; rtpFilePath = "gruvbox-tpm.tmux"; version = "unstable-2019-05-05"; @@ -198,7 +194,7 @@ in rec { }; }; - jump = mkDerivation { + jump = mkTmuxPlugin { pluginName = "jump"; version = "2020-06-26"; rtpFilePath = "tmux-jump.tmux"; @@ -222,7 +218,7 @@ in rec { }; }; - logging = mkDerivation { + logging = mkTmuxPlugin { pluginName = "logging"; version = "unstable-2019-04-19"; src = fetchFromGitHub { @@ -233,7 +229,7 @@ in rec { }; }; - net-speed = mkDerivation { + net-speed = mkTmuxPlugin { pluginName = "net-speed"; version = "unstable-2018-12-02"; src = fetchFromGitHub { @@ -244,7 +240,7 @@ in rec { }; }; - nord = mkDerivation rec { + nord = mkTmuxPlugin rec { pluginName = "nord"; version = "0.3.0"; src = pkgs.fetchFromGitHub { @@ -255,7 +251,7 @@ in rec { }; }; - maildir-counter = mkDerivation { + maildir-counter = mkTmuxPlugin { pluginName = "maildir-counter"; version = "unstable-2016-11-25"; src = fetchFromGitHub { @@ -266,7 +262,7 @@ in rec { }; }; - online-status = mkDerivation { + online-status = mkTmuxPlugin { pluginName = "online-status"; version = "unstable-2018-11-30"; src = fetchFromGitHub { @@ -277,7 +273,7 @@ in rec { }; }; - open = mkDerivation { + open = mkTmuxPlugin { pluginName = "open"; version = "unstable-2019-12-02"; src = fetchFromGitHub { @@ -288,7 +284,7 @@ in rec { }; }; - onedark-theme = mkDerivation { + onedark-theme = mkTmuxPlugin { pluginName = "onedark-theme"; rtpFilePath = "tmux-onedark-theme.tmux"; version = "unstable-2020-06-07"; @@ -300,7 +296,7 @@ in rec { }; }; - pain-control = mkDerivation { + pain-control = mkTmuxPlugin { pluginName = "pain-control"; version = "unstable-2020-02-18"; src = fetchFromGitHub { @@ -311,7 +307,7 @@ in rec { }; }; - plumb = mkDerivation rec { + plumb = mkTmuxPlugin rec { pluginName = "plumb"; version = "0.1.1"; src = fetchFromGitHub { @@ -325,7 +321,7 @@ in rec { ''; }; - power-theme = mkDerivation { + power-theme = mkTmuxPlugin { pluginName = "power"; rtpFilePath = "tmux-power.tmux"; version = "unstable-2020-11-18"; @@ -337,7 +333,7 @@ in rec { }; }; - prefix-highlight = mkDerivation { + prefix-highlight = mkTmuxPlugin { pluginName = "prefix-highlight"; version = "unstable-2020-03-26"; src = fetchFromGitHub { @@ -348,7 +344,7 @@ in rec { }; }; - resurrect = mkDerivation { + resurrect = mkTmuxPlugin { pluginName = "resurrect"; version = "unstable-2020-09-18"; src = fetchFromGitHub { @@ -385,7 +381,7 @@ in rec { }; }; - sensible = mkDerivation { + sensible = mkTmuxPlugin { pluginName = "sensible"; version = "unstable-2017-09-05"; src = fetchFromGitHub { @@ -394,12 +390,12 @@ in rec { rev = "e91b178ff832b7bcbbf4d99d9f467f63fd1b76b5"; sha256 = "1z8dfbwblrbmb8sgb0k8h1q0dvfdz7gw57las8nwd5gj6ss1jyvx"; }; - postInstall = lib.optionalString pkgs.stdenv.isDarwin '' - sed -e 's:reattach-to-user-namespace:${reattach-to-user-namespace}/bin/reattach-to-user-namespace:g' -i $target/sensible.tmux + postInstall = lib.optionalString stdenv.isDarwin '' + sed -e 's:reattach-to-user-namespace:${pkgs.reattach-to-user-namespace}/bin/reattach-to-user-namespace:g' -i $target/sensible.tmux ''; }; - sessionist = mkDerivation { + sessionist = mkTmuxPlugin { pluginName = "sessionist"; version = "unstable-2017-12-03"; src = fetchFromGitHub { @@ -410,7 +406,7 @@ in rec { }; }; - sidebar = mkDerivation { + sidebar = mkTmuxPlugin { pluginName = "sidebar"; version = "unstable-2018-11-30"; src = fetchFromGitHub { @@ -421,7 +417,7 @@ in rec { }; }; - sysstat = mkDerivation { + sysstat = mkTmuxPlugin { pluginName = "sysstat"; version = "unstable-2017-12-12"; src = fetchFromGitHub { @@ -432,7 +428,7 @@ in rec { }; }; - tilish = mkDerivation { + tilish = mkTmuxPlugin { pluginName = "tilish"; version = "2020-08-12"; src = fetchFromGitHub { @@ -451,7 +447,7 @@ in rec { }; }; - tmux-colors-solarized = mkDerivation { + tmux-colors-solarized = mkTmuxPlugin { pluginName = "tmuxcolors"; version = "unstable-2019-07-14"; src = fetchFromGitHub { @@ -462,7 +458,7 @@ in rec { }; }; - tmux-fzf = mkDerivation { + tmux-fzf = mkTmuxPlugin { pluginName = "tmux-fzf"; rtpFilePath = "main.tmux"; version = "unstable-2020-12-07"; @@ -498,7 +494,7 @@ in rec { }; }; - urlview = mkDerivation { + urlview = mkTmuxPlugin { pluginName = "urlview"; version = "unstable-2016-01-06"; src = fetchFromGitHub { @@ -513,7 +509,7 @@ in rec { dependencies = [ pkgs.urlview ]; }; - vim-tmux-focus-events = mkDerivation { + vim-tmux-focus-events = mkTmuxPlugin { pluginName = "vim-tmux-focus-events"; version = "unstable-2020-10-05"; src = fetchFromGitHub { @@ -532,7 +528,7 @@ in rec { }; }; - vim-tmux-navigator = mkDerivation { + vim-tmux-navigator = mkTmuxPlugin { pluginName = "vim-tmux-navigator"; rtpFilePath = "vim-tmux-navigator.tmux"; version = "unstable-2019-12-10"; @@ -544,7 +540,7 @@ in rec { }; }; - yank = mkDerivation { + yank = mkTmuxPlugin { pluginName = "yank"; version = "unstable-2019-12-02"; src = fetchFromGitHub { @@ -554,5 +550,4 @@ in rec { sha256 = "1zg9k8yk1iw01vl8m44w4sv20lln4l0lq9dafc09lxmgxm9dllj4"; }; }; - }