[Nix-dev] Shape configuration.nix differently

2015-05-28 Thread Manuel Pages
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 = "/de

Re: [Nix-dev] Shape configuration.nix differently

2015-05-28 Thread Nicolas Pierron
I am not sure to understand your On Fri, May 29, 2015 at 1:39 AM, Manuel Pages 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 .

Re: [Nix-dev] Shape configuration.nix differently

2015-05-28 Thread Jeffrey David Johnson
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 wrote: > I am not sure to understand your > > On Fri, May 29, 2015

Re: [Nix-dev] Shape configuration.nix differently

2015-05-28 Thread Manuel Pages
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

Re: [Nix-dev] Shape configuration.nix differently

2015-05-28 Thread Nicolas Pierron
For your information, the module system is """basically""" doing the following: let config = pkgs.lib.fold (x: y: pkgs.lib.mergeAttrs x y) {} (map (collect_all_imports) { config = config }); in config Which is why I was wondering what you were trying to do. This also mean that any filed impor