[Nix-dev] Re: FOSDEM 2008 meeting

Nicolas Pierron nicolas.b.pierron at gmail.com
Tue Feb 12 14:35:20 CET 2008


Hi,

On Feb 12, 2008 11:20 AM, Eelco Dolstra <e.dolstra at tudelft.nl> wrote:
> > Wild guess: "nix-env -i" has to read the *whole* Nix expression to get
> > the `name' attributes (e.g., `all-packages.nix' plus all imported Nix
> > expressions), while "nix-env -Ai" could in theory just read
> > `all-packages.nix' and only lazily read the required imported Nix
> > expressions.
>
> Yes, exactly.  nix-env -i has to look at all packages to evaluate the name
> attribute, while nix-env -i -A (= nix-build) only evaluates what is necessary.
> nix-env -i -A also has the advantage that it's unambiguous wrt which package to
> install, so maybe we should make it the primary user interface ;-)

May be ' nix-env -i ' can search in another file which is generated by
evaluating all-packages.nix.
This file would contained all meta information and the name and an
attribute which import all-packages.nix to make the derivation. Badly
this file should be re-generated if the nixpkgs directory or the user
configuration files (and others ...) have changed. Hopefully this
generation should be done only one time after each update.

example:
------ simple-all-packages.nix -------
let pkgs = import /path/to/all-packages.nix {}; in
{
  prog = {
    name = "prog1-0.1";
    meta = { ... };
    derivation = pkgs.prog;
  };

  otherprog = ...;
}
------

-- 
Nicolas Pierron



More information about the nix-dev mailing list