nix-instantiate: default to "default.nix" if no arguments are given

This commit is contained in:
Eelco Dolstra 2012-04-17 17:19:43 +02:00
parent 8745fade03
commit 9cd3ff1059
2 changed files with 5 additions and 3 deletions

View file

@ -50,8 +50,9 @@
<para>The command <command>nix-instantiate</command> generates <link <para>The command <command>nix-instantiate</command> generates <link
linkend="gloss-derivation">store derivations</link> from (high-level) linkend="gloss-derivation">store derivations</link> from (high-level)
Nix expressions. It loads and evaluates the Nix expressions in each Nix expressions. It loads and evaluates the Nix expressions in each
of <replaceable>files</replaceable>. Each top-level expression should of <replaceable>files</replaceable> (which defaults to
evaluate to a derivation, a list of derivations, or a set of <replaceable>./default.nix</replaceable>). Each top-level expression
should evaluate to a derivation, a list of derivations, or a set of
derivations. The paths of the resulting store derivations are printed derivations. The paths of the resulting store derivations are printed
on standard output.</para> on standard output.</para>

View file

@ -148,7 +148,8 @@ void run(Strings args)
Expr * e = parseStdin(state); Expr * e = parseStdin(state);
processExpr(state, attrPaths, parseOnly, strict, autoArgs, processExpr(state, attrPaths, parseOnly, strict, autoArgs,
evalOnly, xmlOutput, xmlOutputSourceLocation, e); evalOnly, xmlOutput, xmlOutputSourceLocation, e);
} } else if (files.empty())
files.push_back("./default.nix");
foreach (Strings::iterator, i, files) { foreach (Strings::iterator, i, files) {
Expr * e = state.parseExprFromFile(lookupFileArg(state, *i)); Expr * e = state.parseExprFromFile(lookupFileArg(state, *i));