Yep, there has been previous ML discussions about this.
Short story is that local variables always take precedence over
variables from "with" expressions.
This is kind of a security feature, otherwise the following expression
could change its meaning when an "outer" package is added/removed from
the "pkgs" set.
`let outer = "5"; in with pkgs; [ outer ];`
That being said, a warning would be a nice idea.
-- Layus.
On 22/03/17 16:12, José Luis Lafuente wrote:
Recently I was having a weird error running nixos-rebuild. I added
some packages to systemPackages and I was getting this error:
cannot coerce a set to a string, at
/etc/nixos/nixpkgs/lib/strings.nix:442:44
After some debugging I found that the guilty was the boot package, but
I needed some time to understand why. In my configuration.nix I have this:
environment.systemPackages = with pkgs; [
.....
boot
];
But 'boot' refers to the option 'boot', not the package 'boot'. For
me, that behavior is confusing (at least in the programming languages
I know the inner scope variables shadow the ones on the outer scope).
In my example, is there a way to make 'boot' refer to 'pkgs.boot'? or
a way of getting a warning on this case?
Regards,
Jose Luis
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev