Roshan-R / termv

A terminal iptv player written in bash
GNU General Public License v3.0
232 stars 21 forks source link

Add Nix Flake #16

Closed Deleh closed 3 years ago

Deleh commented 3 years ago

This PR makes this project a Nix Flake. Users with a recent version of the Nix package manager can then execute termv with the following command:

nix run github:Roshan-R/termv

Nix is available for all Linux distributions, MacOS and Windows (via WSL) and provides reproducible builds.

If this is a Flake, it is also possible to install termv as a system package on Flake-injected NixOS installations even though it's not available in the nixpkgs package repo.

Feel free to reject this PR if you want to keep the repo clean and don't see any use in this.. I just added it because I want to use it myself and thought some other people may enjoy this too. Thank you for this nice script :)

Roshan-R commented 3 years ago

Hey @Deleh Thanks for the PR! Glad you liked the project

I'm not really familiar with the nix package manager but this seems like a really convenient way of installing programs

Deleh commented 3 years ago

The difference between Nix and classic package managers is that packages are described in a functional language. The inputs are the dependencies of the package and the output is the compiled package. The functional approach makes it possible, for example, to install different package versions in parallel. This comletely eliminates the dependency-hell. Furthermore, it ensures that when a package builds on one machine, it builds exactly identically on all others.

Classically, package descriptions are added to a mono repo, the nixpkgs. However, the great Nix folks have now developed a decentralized package-management approach, the flakes. The build description of this package can be found in the flake.nix file. Inputs are the nixpkgs and something called flake-utils which eases the writing of flakes. the flake.lock file pins the dependencies to a specific version. This ensures that no matter who runs this flake, the exact identical and 100% working version is always run. You also don't have to worry about dependencies anymore, Nix does it for you :)

Roshan-R commented 3 years ago

Thanks for the detailed explanation, I went through everything and came to the conclusion that this would be really beneficial to this project.

Nix has a really cool concept and I'm definitely going to try it when I get a chance :smile:

Deleh commented 3 years ago

Nice, thank you :)