Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds installation instructions for installing with Nix #883

Merged

Conversation

ChristopherHarwell
Copy link
Contributor

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 and tmuxp while ensuring that tmux is installed before installing tmuxp can be explained as follows:

  1. The command starts with [[ -z $(which tmux) ]] &&.
    - [[ -z $(which tmux) ]] checks if the command which tmux returns an empty string, indicating that tmux 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.

  2. 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.

  3. If tmux is found, the command executes the following block: (nix-env -i tmux && nix-env -i tmuxp)2.
    - (command1 && command2) executes command1 and then command2 if command1 succeeds.
    - nix-env -i tmux installs tmux using the nix-env command.
    - nix-env -i tmuxp installs tmuxp using the nix-env command.

  4. If tmux is already installed, the command executes the following block: nix-env -i tmuxp.
    - This block directly installs tmuxp using the nix-env command.

In summary, the one-liner command checks if tmux is installed, and if not, it displays a message to install tmux first. Otherwise, it installs tmux and then installs tmuxp.

References:

Footnotes

  1. github.com - tmux wiki 2

  2. github.com - installing tmux + tmuxp with Nix

@CLAassistant
Copy link

CLAassistant commented Aug 31, 2023

CLA assistant check
All committers have signed the CLA.

@tony
Copy link
Member

tony commented Sep 1, 2023

@ChristopherHarwell A very detailed PR description. Well done!

Are you up to signing the CLA before I merge?

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #883 (70a9a31) into master (f794f31) will not change coverage.
Report is 63 commits behind head on master.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #883   +/-   ##
=======================================
  Coverage   71.29%   71.29%           
=======================================
  Files          25       25           
  Lines        1850     1850           
  Branches      410      410           
=======================================
  Hits         1319     1319           
  Misses        411      411           
  Partials      120      120           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tony
Copy link
Member

tony commented Sep 2, 2023

@ChristopherHarwell Hi, thanks again for the contribution.

Can you sign the CLA?

@tony
Copy link
Member

tony commented Sep 9, 2023

@ChristopherHarwell Hi! Can you take a look at this?

@ChristopherHarwell
Copy link
Contributor Author

Yes. I just signed it.

@tony
Copy link
Member

tony commented Sep 9, 2023

@ChristopherHarwell Thank you!

@tony tony merged commit 54157e1 into tmux-python:master Sep 9, 2023
15 checks passed
@tony
Copy link
Member

tony commented Sep 9, 2023

@ChristopherHarwell Live in 1.30.1 (PyPI, highlight, current README, highlight)

@tony
Copy link
Member

tony commented Sep 9, 2023

Thank you once again for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants