[Nix-dev] nix-build failing to run

Lluís Batlle viriketo at gmail.com
Sun Jul 19 19:56:04 CEST 2009


Nixpkgs is a single nix expression, which has all the 'programs'
related between them, so you can ask for one of them, so it gets built
and installed. The nixpkgs expression starts at 'default.nix', and
goes on importing files, and those import more files, until all .nix
files in nixpkgs are included.

I think you wanted to write something like one of those sparse .nix
files in nixpkgs, and tried to build from it as if it could work
isolated from the rest of nixpkgs.

'stdenv' is one of the components described in nixpkgs, so you have to
make nixpkgs include your .nix file, which (I guess) implements a nix
function which expects 'stdenv' as a parameter.

Following the imports from default.nix, you will end up in
pkgs/top-level/all-packages.nix. Read a bit this file, and see how
many functions from .nix files are imported and called with the proper
parameters (stdenv, fetchurl, ...).

You will notice that also your $HOME/.nixpkgs/config.nix is imported
somewhere, and try to guess what does a packagesOverride attribute if
that config.nix were an attribute set. Look at the parameters
config.nix is called with.

Otherwise, you can also modify your all-packages putting a direct
reference to your function importing your .nix file.

Regards,
Lluís.

2009/7/19 Bill Trost <trost at cloud.rain.com>:
> I discovered that nixpkgs was missing a simple program I wanted,
> so I thought I'd try my hand at a simple nix expression.
> So, I wrote a default.nix file in an empty directory and
> ran "nix-build -A quilt", only to get the error message
>
>  error: cannot auto-call a function that has an argument without a default value (`stdenv')
>
> Aside from the fairly obvious "huh?" factor from the error message, the
> real question is, what am I missing? Do I need to install something
> else, or is it just that the command line is missing something?
>
> Thanks,
> Bill
> _______________________________________________
> nix-dev mailing list
> nix-dev at cs.uu.nl
> https://mail.cs.uu.nl/mailman/listinfo/nix-dev
>



More information about the nix-dev mailing list