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
tmuxp
with Nix package manager.What does the one-command do?
The one-liner command using Nix to install
tmux
andtmuxp
while ensuring thattmux
is installed before installingtmuxp
can be explained as follows:The command starts with
[[ -z $(which tmux) ]] &&
.-
[[ -z $(which tmux) ]]
checks if the commandwhich tmux
returns an empty string, indicating thattmux
is not found.- The double brackets
[[ ... ]]
are used for conditional tests in shell scripts.- The
-z
flag 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
tmux
is not found, the command executes the following block:echo "tmux not found, please install tmux first"
.- This block displays a message indicating that
tmux
needs to be installed before proceeding with tmuxp installation.If
tmux
is found, the command executes the following block:(nix-env -i tmux && nix-env -i tmuxp)
2.-
(command1 && command2)
executescommand1
and thencommand2
ifcommand1
succeeds.-
nix-env -i tmux
installs tmux using thenix-env
command.-
nix-env -i tmuxp
installs tmuxp using thenix-env
command.If tmux is already installed, the command executes the following block:
nix-env -i tmuxp
.- This block directly installs
tmuxp
using thenix-env
command.In summary, the one-liner command checks if
tmux
is installed, and if not, it displays a message to installtmux
first. Otherwise, it installstmux
and then installstmuxp
.References:
Footnotes
github.com - tmux wiki ↩ ↩2
github.com - installing tmux + tmuxp with Nix ↩