Adds installation instructions for installing with Nix #883
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change add?
I updated to README to have a one liner shell script for installing
tmuxpwith Nix package manager.What does the one-command do?
The one-liner command using Nix to install
tmuxandtmuxpwhile ensuring thattmuxis installed before installingtmuxpcan be explained as follows:The command starts with
[[ -z $(which tmux) ]] &&.-
[[ -z $(which tmux) ]]checks if the commandwhich tmuxreturns an empty string, indicating thattmuxis not found.- The double brackets
[[ ... ]]are used for conditional tests in shell scripts.- The
-zflag checks if the string is empty 1.-
$(...)is command substitution, which executes the command within the parentheses and replaces it with the output of that command 1.If
tmuxis not found, the command executes the following block:echo "tmux not found, please install tmux first".- This block displays a message indicating that
tmuxneeds to be installed before proceeding with tmuxp installation.If
tmuxis found, the command executes the following block:(nix-env -i tmux && nix-env -i tmuxp)2.-
(command1 && command2)executescommand1and thencommand2ifcommand1succeeds.-
nix-env -i tmuxinstalls tmux using thenix-envcommand.-
nix-env -i tmuxpinstalls tmuxp using thenix-envcommand.If tmux is already installed, the command executes the following block:
nix-env -i tmuxp.- This block directly installs
tmuxpusing thenix-envcommand.In summary, the one-liner command checks if
tmuxis installed, and if not, it displays a message to installtmuxfirst. Otherwise, it installstmuxand then installstmuxp.References:
Footnotes
github.com - tmux wiki ↩ ↩2
github.com - installing tmux + tmuxp with Nix ↩