[Nix-dev] With-expressions question

José Luis Lafuente jl at lafuente.me
Wed Mar 22 16:12:38 CET 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170322/fd7f7190/attachment.html>


More information about the nix-dev mailing list