[Nix-dev] Shape configuration.nix differently

Jeffrey David Johnson jefdaj at gmail.com
Fri May 29 02:04:03 CEST 2015


Isn't that the same as

```
{
  imports = [
    ./hardware-configuration.nix
    ./boot/grub.nix
  ];
}
```

? I think you can still access config and pkgs from each file.
Jeff

On Fri, 29 May 2015 01:55:34 +0200
Nicolas Pierron <nicolas.b.pierron at gmail.com> wrote:

> I am not sure to understand your
> 
> On Fri, May 29, 2015 at 1:39 AM, Manuel Pages
> <amarr.industrial at gmail.com> wrote:
> > Hey, I'm working on a differently-shaped /etc/nixos/configuration.nix.
> >
> > My vision is to shape it like this:
> >
> > ```
> > { config, pkgs, ... }:
> > pkgs.lib.fold (x: y: pkgs.lib.mergeAttrs x y) {} [
> >   import ./hardware-configuration.nix { pkgs = pkgs; config = config; }
> >   import ./boot/grub.nix { device = "/dev/sda"; }
> >   # ...
> > ]
> > ```
> 
> The problem that you see is that recent modifications of the module
> system change pkgs to be the result of the configuration, instead of
> being the one from your system.
> This change as a side-effect of making pkgs.lib cause infinite recursions.
> 
> Then, I am not completely sure to understand what you want to achieve
> which cannot be done with the module system?
> 
> -- 
> Nicolas Pierron
> http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list