1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02:00

Add 'nix eval' manpage

This commit is contained in:
Eelco Dolstra 2020-12-09 18:34:52 +01:00
parent 53ce20eab7
commit a407d14339
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 78 additions and 23 deletions

View file

@ -40,30 +40,11 @@ struct CmdEval : MixJSON, InstallableCommand
return "evaluate a Nix expression";
}
Examples examples() override
std::string doc() override
{
return {
{
"To evaluate a Nix expression given on the command line:",
"nix eval --expr '1 + 2'"
},
{
"To evaluate a Nix expression from a file or URI:",
"nix eval -f ./my-nixpkgs hello.name"
},
{
"To get the current version of Nixpkgs:",
"nix eval --raw nixpkgs#lib.version"
},
{
"To print the store path of the Hello package:",
"nix eval --raw nixpkgs#hello"
},
{
"To get a list of checks in the 'nix' flake:",
"nix eval nix#checks.x86_64-linux --apply builtins.attrNames"
},
};
return
#include "eval.md"
;
}
Category category() override { return catSecondary; }