Files
ccpkgs/README.md
2016-05-18 12:24:32 -04:00

1.9 KiB

Overview

This package contains a collection of Nix expressions created by SHARCNET staff for various software packages. Once copied or linked into your ~/.nix-defexpr directory they will allow you to install the associated package into your Nix environment.

These directions assume you have loaded the Nix module (this enabes your Nix environment and makes the various Nix commands avaialble)

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)

cd ~
git clone https://git.sharcnet.ca/tyson/nix-nixpkgs-sharcnet.git

If you already have a copy, you can update to the latest version

cd ~/nix-nixpkgs-sharcnet
git pull

Installing an expression

To use any of the provided Nix expressions, you need to copy it to or link it into your ~/.nix-defexpr directory (replace package.nix with the name of the Nix expression you wish to use)

ln -s ../nix-nixpkgs-sharcnet/package.nix ~/.nix-defexpr/

Using a symbolic link has the advantage that it automatically gets updated whenever you update ~/nix-nixpkgs-sharcnet.

Using an expression

Once you have the expression in your ~/.nix-defexpr you can use the nix-env command to install (or update) the associated package in your Nix environment.

Installing and updating

To install or update the associated package (replace package with the base name of the Nix expression file you copied to ~/.nix-defexpr)

nix-env --install --attr package

Removing

To remove a package you first need to figure out its name (generally, but not nessesarily, the same as the name of the Nix expression file)

nix-env --query

Then you (replace package with the package name)

nix-env --uninstall package

Reverting

To undo the last install/update/remove command

nix-env --rollback