---
This is a really cool shell script that allows for multi-user tmux, for pair
programming and such. It's not very fancy (install is just cp), but I'm adding
it for discoverability ('nix search' is awesome). It has a manpage but I'm not
sure how to generate that, should I use scdoc?
scdoc is packaged and you can just run in in buildPhase if it isn't
invoked by a Makefile. Also the installShellFiles package may be
interesting for you which allows you to call installManPage in the
installPhase to automatically figure out the right directory.
pkgs/tools/misc/wemux/default.nix | 24 ++++++++++++++++++++++++
pkgs/top-level/all-packages.nix | 2 ++
2 files changed, 26 insertions(+)
create mode 100644 pkgs/tools/misc/wemux/default.nix
diff --git a/pkgs/tools/misc/wemux/default.nix b/pkgs/tools/misc/wemux/default.nix
new file mode 100644
index 00000000000..8efe361e88e
--- /dev/null
+++ b/pkgs/tools/misc/wemux/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, fetchFromGitHub, tmux }:
+
+stdenv.mkDerivation rec {
+ name = "wemux-${version}";
+ version = "2021-04-16";
+ src = fetchFromGitHub {
+ owner = "zolrath";
+ repo = "wemux";
+ rev = "01c6541f8deceff372711241db2a13f21c4b210c";
+ sha256 = "1y962nzvs7sf720pl3wa582l6irxc8vavd0gp4ag4243b2gs4qvm";
+ };
+ buildInputs = [ tmux ];
Note that this has no implication on runtime per se. You need to make
wemux permanently pick up the path of tmux to make it available at
runtime. The cleanest solution in this case would be to patch the file,
so the tmux binary is hardcoded. Another alternative would be using
makeWrapper to generate a wrapper script which adds tmux to PATH.
+ installPhase = ''
+ mkdir -p $out/bin
+ install ${src}/wemux $out/bin
+ '';
Better would be:
```
installPhase = ''
runHook preInstall
install -Dm755 wemux -t $out/bin
runHook postInstall
'';
```
Rationale being:
* unpackPhase takes care of extracting src into the working directory.
using ${src} takes the fetch-derivation directly which has the
following problems:
* Overriding src won't work anymore.
* We rely on the fetch derivation to extract the archive. This is
done by fetchFromGitHub and fetchzip, but not by, for example
fetchurl.
* running the preInstall and postInstall hooks is important since they
can be overridden and are commonly used to inject some extra code into
the install phase.
+ meta = with lib; {
+ homepage = "https://github.com/zolrath/wemux";
+ description = "Multi-user tmux made easy";
+ license = licenses.mit;
+ platforms = platforms.all;
+ maintainers = with maintainers; [ bsima ];
+ };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1aaa5d59a66..e38e504256d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7757,6 +7757,8 @@ in
welkin = callPackage ../tools/graphics/welkin {};
+ wemux = callPackage ../tools/misc/wemux { };
+
wf-recorder = callPackage ../applications/video/wf-recorder { };
whipper = callPackage ../applications/audio/whipper { };
--
2.31.1