diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2018-04-06 18:51:10 +0200 |
---|---|---|
committer | John Ericson <Ericson2314@yahoo.com> | 2018-04-07 13:21:49 -0400 |
commit | e1dee4efcbffc72260025078bf8297a3b732509c (patch) | |
tree | 567b274abbd1dc708037ea7f9933bce98671167b /lib/modules.nix | |
parent | 95ece9efe5104522ed024e3858d46f17bc6aaf16 (diff) |
lib: make extensible
This allows the lib fixed point to be extended with
myLib = lib.extend (self: super: {
foo = "foo";
})
With this it's possible to have the new modified lib attrset available to all
modules when using evalModules
myLib.evalModules {
modules = [ ({ lib, ... }: {
options.bar = lib.mkOption {
default = lib.foo;
};
}) ];
}
=> { config = { bar = "foo"; ... }; options = ...; }
Diffstat (limited to 'lib/modules.nix')
-rw-r--r-- | lib/modules.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/modules.nix b/lib/modules.nix index acd07f732bd..4ef982c7ec9 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -59,7 +59,7 @@ rec { }; }; - closed = closeModules (modules ++ [ internalModule ]) ({ inherit config options; lib = import ./.; } // specialArgs); + closed = closeModules (modules ++ [ internalModule ]) ({ inherit config options lib; } // specialArgs); options = mergeModules prefix (reverseList (filterModules (specialArgs.modulesPath or "") closed)); |