aboutsummaryrefslogtreecommitdiff
path: root/modules/default.nix
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2020-01-16 23:41:14 +0100
committerRobert Helgesson <robert@rycee.net>2020-01-21 20:47:04 +0100
commit6e4b9af0803ac00e94398768c5d19d2e423b0be9 (patch)
tree65f117f6a8b562348eaf12469dadb084af2be417 /modules/default.nix
parentc8323a0bf16acf2c9d89ce164568089017d19668 (diff)
Switch to extended Nixpkg's `lib`
This change makes use of the `extend` function inside `lib` to inject a new `hm` field containing the Home Manager library functions. This simplifies use of the Home Manager library in the modules and reduces the risk of accidental infinite recursion. PR #994
Diffstat (limited to 'modules/default.nix')
-rw-r--r--modules/default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/default.nix b/modules/default.nix
index 9f6404ff9cc..7f3494e4dea 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -19,10 +19,16 @@ let
in
fold f res res.config.warnings;
- rawModule = lib.evalModules {
- modules =
- [ configuration ]
- ++ (import ./modules.nix { inherit check lib pkgs; });
+ extendedLib = import ./lib/stdlib-extended.nix pkgs.lib;
+
+ hmModules =
+ import ./modules.nix {
+ inherit check pkgs;
+ lib = extendedLib;
+ };
+
+ rawModule = extendedLib.evalModules {
+ modules = [ configuration ] ++ hmModules;
specialArgs = {
modulesPath = builtins.toString ./.;
};