# Overview This package contains a collection of Nix expressions created by SHARCNET staff for various software packages. You can use them to install the associated packages into your Nix environment. These directions assume you have loaded the Nix module (this enables your Nix environment and makes the various Nix commands available) ```sh module load nix ``` # Obtaining the latest expressions If you don't yet have a copy of *~/nix-nixpkgs-sharcnet*, you will need to clone a copy (use your SHARCNET credentials) ```sh cd ~ git clone https://git.sharcnet.ca/nix/nixpkgs-sharcnet.git ``` If you already have a copy, you can update to the latest version ```sh cd ~/nix-nixpkgs-sharcnet git pull ``` # Using an expression Once you have a copy of the expressions you can use `nix-env` to install, update, or remove them from your environment. ## Installing an expression To install (or update) a package pass the corresponding file (replace *package.nix* in what follows) to `nix-env` using the `--file` option ```sh nix-env --install --file package.nix ``` You can also copy or symlink the file into your *~/.nix-defexpr* directory and then refer to it as a top-level attribute (replace *package* with the base name of the copied file) ```sh nix-env --install --attr package ``` ## Removing To remove a package you first need to figure out its name (generally, but not necessarily, the same as the name of the Nix expression file) ```sh nix-env --query ``` Then you (replace *package* with the package name) ```sh nix-env --uninstall package ``` ## Reverting To undo the last install/update/remove command ```sh nix-env --rollback ```