Use --file to install directly instead of copying to ~/.nix-defexp
This commit is contained in:
46
README.md
46
README.md
@@ -1,12 +1,11 @@
|
|||||||
# Overview
|
# Overview
|
||||||
|
|
||||||
This package contains a collection of Nix expressions created by
|
This package contains a collection of Nix expressions created by
|
||||||
SHARCNET staff for various software packages. Once copied or linked
|
SHARCNET staff for various software packages. You can use them to
|
||||||
into your *~/.nix-defexpr* directory they will allow you to install
|
install the associated packages into your Nix environment.
|
||||||
the associated package into your Nix environment.
|
|
||||||
|
|
||||||
These directions assume you have loaded the Nix module (this enabes
|
These directions assume you have loaded the Nix module (this enables
|
||||||
your Nix environment and makes the various Nix commands avaialble)
|
your Nix environment and makes the various Nix commands available)
|
||||||
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -30,31 +29,24 @@ cd ~/nix-nixpkgs-sharcnet
|
|||||||
git pull
|
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)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
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
|
# Using an expression
|
||||||
|
|
||||||
Once you have the expression in your *~/.nix-defexpr* you can use the
|
Once you have a copy of the expressions you can use `nix-env` to
|
||||||
`nix-env` command to install (or update) the associated package in
|
install, update, or remove them from your environment.
|
||||||
your Nix environment.
|
|
||||||
|
|
||||||
## Installing and updating
|
|
||||||
|
|
||||||
To install or update the associated package (replace *package* with
|
## Installing an expression
|
||||||
the base name of the Nix expression file you copied to
|
|
||||||
*~/.nix-defexpr*)
|
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
|
```sh
|
||||||
nix-env --install --attr package
|
nix-env --install --attr package
|
||||||
@@ -63,7 +55,7 @@ nix-env --install --attr package
|
|||||||
## Removing
|
## Removing
|
||||||
|
|
||||||
To remove a package you first need to figure out its name (generally,
|
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)
|
but not necessarily, the same as the name of the Nix expression file)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
nix-env --query
|
nix-env --query
|
||||||
|
|||||||
Reference in New Issue
Block a user