Re: [Nix-dev] error: cannot auto-call a function that has an argument without a default value (‘stdenv’)

2017-07-07 Thread Christian Kauhaus via nix-dev
Am 07.07.2017 um 08:07 schrieb Vladimír Čunát via nix-dev:
> That's how it's commonly done in nixpkgs.  If you want a *separate*
> expression that depends on nixpkgs, you may e.g. start by adding this
> line to the beginning of the file:
> with import  {};
> instead of
> { stdenv, something1, something2, ... }:

Another solution (at least commonly used here at Flying Circus IO):

* leave the package expr as-is
* call it with the idiom 

  nix-build -E 'with import  {}; callPackage ./hello.nix {}'


HTH

Christian

-- 
Dipl-Inf. Christian Kauhaus <>< · k...@flyingcircus.io · +49 345 219401-0
Flying Circus Internet Operations GmbH · http://flyingcircus.io
Forsterstraße 29 · 06112 Halle (Saale) · Deutschland
HR Stendal 21169 · Geschäftsführer: Christian Theune, Christian Zagrodnick



signature.asc
Description: OpenPGP digital signature
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] error: cannot auto-call a function that has an argument without a default value (‘stdenv’)

2017-07-06 Thread Vladimír Čunát via nix-dev
On 07/06/2017 05:54 PM, tj5527 via nix-dev wrote:
> Following the example
> at http://nixos.org/nix/manual/#chap-writing-nix-expressions to build
> hello package. But `nix-build -A hello` throws error "error: cannot
> auto-call a function that has an argument without a default value
> (‘stdenv’)"
> 
> How can I fix this problem?

Well, apparently you try to evaluate a standalone file that specifies a
function but you don't specify how to fill its parameters.  It should be
explained in the following section
http://nixos.org/nix/manual/#sec-arguments

That's how it's commonly done in nixpkgs.  If you want a *separate*
expression that depends on nixpkgs, you may e.g. start by adding this
line to the beginning of the file:
with import  {};
instead of
{ stdenv, something1, something2, ... }:

--Vladimir
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev


[Nix-dev] error: cannot auto-call a function that has an argument without a default value (‘stdenv’)

2017-07-06 Thread tj5527 via nix-dev
Following the example at 
http://nixos.org/nix/manual/#chap-writing-nix-expressions to build hello 
package. But `nix-build -A hello` throws error "error: cannot auto-call a 
function that has an argument without a default value (‘stdenv’)"
How can I fix this problem?
My nix-build (Nix) is 1.11.11
Thanks___
nix-dev mailing list
nix-dev@lists.science.uu.nl
https://mailman.science.uu.nl/mailman/listinfo/nix-dev