Conversation
modules/modules.nix
Outdated
| config._module.args.baseModules = modules; | ||
| config._module.args.pkgs = lib.mkDefault pkgs; | ||
| config._module.check = check; | ||
| config.lib.dag = import lib/dag.nix { inherit lib; }; |
There was a problem hiding this comment.
I think we could use this opportunity to make it possible to add more general purpose functions to the library. Adding a lib/default.nix with
{ lib }: {
dag = import ./dag { inherit lib; };
...
}Then config.lib = import ./lib { inherit lib; }; (or config.lib.home = ...)
This also calls for a DAG library refactor, such that you can use config.lib.dag.entryAfter instead of config.lib.dag.dagEntryAfter, etc.
There was a problem hiding this comment.
Yeah, I was thinking about the function renaming. Unfortunately it would break the configuration of anybody who uses the dag functions directly.
I'm now thinking the config.lib.dag entries actually should be different from the dag.nix file. I.e., to have config.lib.dag = { …; entryAfter = dagEntryAfter; … }; etc. The old dag.nix could be deprecated and removed in the future.
Also agree on the use of lib/default.nix.
There was a problem hiding this comment.
Good idea regarding the slow deprecation
|
Force-pushed updated code. |
|
Apparently it also works to just use actual modules, for some reason I don't get recursion when I do this: infinisil@efc486b This also enables having the |
|
Hmm, when I switch with config.lib;
with lib;to with lib;
with config.lib;e.g. in with or without your changes. I tried to track this down but unfortunately couldn't find the cause. |
391f1df to
b0fc32b
Compare
Also replace all imports of `dag.nix` by the entry in `config.lib`.
b0fc32b to
f0d207f
Compare
|
Replaced all use of |
Also replace all imports of
dag.nixby the entry inconfig.lib.