[Nix-dev] Shape configuration.nix differently

Manuel Pages amarr.industrial at gmail.com
Fri May 29 01:39:35 CEST 2015


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"; }
  # ...
]
```

however, I get "infinite recursion" even with reduced case (when I run
nixos-rebuild test), where reduced case is

```
{ pkgs, ... }: pkgs.lib.fold (x: y: pkgs.lib.mergeAttrs x y) {} []
```

I guess that in the code that executes configuration.nix there is some
werid reference magic.
Then I don't understand why does a "simple" configuration.nix work?

Any hints on how to proceed with this refactoring of configuration.nix
are highly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150529/318247db/attachment-0001.html 


More information about the nix-dev mailing list