From bca039c1033819a51c74b0794fbc9d0aea76a786 Mon Sep 17 00:00:00 2001 From: Dustin Lacewell Date: Thu, 19 Oct 2017 22:35:38 -0500 Subject: [PATCH] Add experimental plugin support --- modules/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index a8729947..32e77511 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -72,14 +72,19 @@ let in fold f res res.config.warnings; + pluginModule = import (builtins.toPath (builtins.getEnv "HOME_MANAGER_PLUGINS")); + pluginArgs = { inherit pkgs lib; }; + pluginPkgs = lib.mapAttrs (k: v: v pluginArgs) pluginModule; + pluginModules = lib.mapAttrsFlatten (k: v: v.module) pluginPkgs; + pkgsModule = { - config._module.args.pkgs = lib.mkForce pkgs; + config._module.args.pkgs = lib.mkForce pkgs // pluginPkgs; config._module.args.baseModules = modules; config._module.check = check; }; rawModule = lib.evalModules { - modules = [ configuration ] ++ modules ++ [ pkgsModule ]; + modules = [ configuration ] ++ modules ++ [ pkgsModule ] ++ pluginModules; }; module = showWarnings (