![]() ![]() ![]() It must be reproducable meaning that I should be able to check my env.nix into version control, check it out later-on another machine-and get the same set of packages installed and.It must be declarative in that I can write a simple file (I call mine env.nix) which specifies the list of packages to install.My requirements for using Nix as a package management system are simple. Consistent, reproducable, declarative package management I’m not interested in building software using Nix. Of these, I’m interested in declarative package management, one-off shells, and developer environments, in that order. The last use case is similar to the second except that rather than just have the dependencies be installed and managed by Nix, the whole project is built by Nix. Which would fire up a new Bash shell with socat installed and ready to run. For example, if you need a shell with socat installed and don’t want to install it in your normal environment using nix-env, you would run Rather than install and remove packages as necessary, Nix lets you create a one-off shell that contains a set of packages. The third use case is Nix’s killer feature in my mind. All developers can use the nix-shell command to launch a Bash shell with the appropriate dependencies installed and available.) This use case seems more aspirational than practical since it requires all developers use Nix to get this benefit. These dependencies can be specified in the shell.nix file. (E.g., a Python project may require other Python packages to be installed. Nix’s second use case lets developers declaratively specify a (more or less) complete environment for a project in a shell.nix file. Nix also supports a declarative package management system where you put the list of packages you want in a file and then you can (for example) check that file into version control. ![]() Like any good package manager, this will install rg along with any dependencies. For example, if you want to install the excellent ripgrep tool, you’d use the following command. It’s usually used on the command line to install packages incrementally. The tool for this is called nix-env and it’s responsible for installing packages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |