[Nix-dev] evalModules: how to use it?

Daniel Hlynskyi abcz2.uprola at gmail.com
Wed Jul 6 18:06:20 CEST 2016


Hi. I have a container generator:

mkContainer =
{ config, lib
, additionalConfig ? {}
}:
let
  containerParams =
   { autoStart = true;
   };
in
containerParams //
{ config = { config, pkgs, lib, ... }:
  { imports = [
      <fleet/services/common.nix>
      <fleet/services/tomcat.nix>
      <fleet/services/networking.nix>
    ];

    networking.firewall.enable = false;
  } // additionalConfig;
}

And I have a container

containers.test = mkContainer { inherit config lib;
  additionalConfig = {
    networking.firewall.enable = lib.mkForce true;
  };
};

But this is wrong - I can't just // two configurations. AFAIU there is
lib.evalModules function. How can I use to implement custom overrides?
My mind is already blowned with it's implementation and dozens of different
ways to use it are tried with no success.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160706/9a416f3d/attachment.html>


More information about the nix-dev mailing list