It seems that it is only possible to specify files in the require attribute of 
a Nix module, e.g.:

{pkgs, ...}:

{
  require = [ /some/nixos/module/file.nix ]; # Works fine

  services.openssh.enable = true;
}

But it seems that it is impossible to specify functions or attribute sets, e.g.:

{pkgs, ...}:

{
  require = [ { services.httpd.enable = true; } ]; # Triggers an error

  services.openssh.enable = true;
}

I'm curious whether it is possible to also require functions or attribute sets. 
The reason I'm asking this is, that I'm working on a function that generates a 
network of NixOS configurations running web applications. In some cases you may 
want to run a database server and web server on a single machine, in other 
cases you may want to run a database and web server on separate machines. 

I think using the require attribute is the best way to combine certain 
properties into a single NixOS configuration.
_______________________________________________
nix-dev mailing list
nix-dev@cs.uu.nl
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to