[Nix-dev] Shape configuration.nix differently
Manuel Pages
amarr.industrial at gmail.com
Fri May 29 02:24:27 CEST 2015
Dear Nicolas, I have already read the diffs and lib/modules.nix
and am sad. I don't have enough knowledge to criticize those changes
though.
Dear Jeffery, this way my "submodules" are shaped as a first-order
functions (Submodule :: Set -> Set), with your approach we
actually have (Submodule :: Set -> (Set -> Set)) which is fine by
me and I'll use this approach for now.
Thank you very much!
On Fri, May 29, 2015 at 2:04 AM, Jeffrey David Johnson <jefdaj at gmail.com>
wrote:
> 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
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
--
Fly safe,
Sloz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150529/6688df9b/attachment.html
More information about the nix-dev
mailing list