mirror of
https://github.com/NixOS/nix
synced 2025-07-08 15:13:55 +02:00
* `nix-env -qa --description' shows human-readable descriptions of
packages (provided that they have a `meta.description' attribute). E.g., $ ./src/nix-env/nix-env -qa --description gcc gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for sparc-linux) gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for mips-linux) gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for arm-linux) gcc-4.0.2 GNU Compiler Collection, 4.0.x
This commit is contained in:
parent
a33fb2d287
commit
37d1b1cafd
7 changed files with 79 additions and 25 deletions
|
@ -7,12 +7,16 @@ assert foo == "foo";
|
|||
|
||||
let {
|
||||
|
||||
makeDrv = name: progName: derivation {
|
||||
makeDrv = name: progName: (derivation {
|
||||
inherit name progName system;
|
||||
builder = "@shell@";
|
||||
shell = "@shell@";
|
||||
args = ["-e" "-x" ./user-envs.builder.sh];
|
||||
};
|
||||
} // {
|
||||
meta = {
|
||||
description = "A silly test package";
|
||||
};
|
||||
});
|
||||
|
||||
body = [
|
||||
(makeDrv "foo-1.0" "foo")
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
source common.sh
|
||||
|
||||
profiles="$NIX_STATE_DIR"/profiles
|
||||
rm -f $profiles/*
|
||||
|
||||
# Query installed: should be empty.
|
||||
test "$($nixenv -p $profiles/test -q '*' | wc -l)" -eq 0
|
||||
|
@ -8,6 +9,9 @@ test "$($nixenv -p $profiles/test -q '*' | wc -l)" -eq 0
|
|||
# Query available: should contain several.
|
||||
test "$($nixenv -p $profiles/test -f ./user-envs.nix -qa '*' | wc -l)" -eq 5
|
||||
|
||||
# Query descriptions.
|
||||
$nixenv -p $profiles/test -f ./user-envs.nix -qa '*' --description | grep silly
|
||||
|
||||
# Install "foo-1.0".
|
||||
$nixenv -p $profiles/test -f ./user-envs.nix -i foo-1.0
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue