Skip to content

Commit

Permalink
fix(pops.modules): use mkMerge with winnow
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed May 1, 2024
1 parent 8eca30c commit 9096efa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion local/cells/repo/pops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in
configs = inputs.omnibus.pops.configs {
inputs = {
inputs = {
inherit (inputs') nixfmt pre-commit-hooks;
inherit (inputs') nixfmt git-hooks;
inherit (inputs) std;
inherit nixpkgs;
};
Expand Down
22 changes: 11 additions & 11 deletions local/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions src/haumea/importModule.nix
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ in
in
loadExtendModuleFromValue;

winnow =
path: module: fun:
({
config =
winnow = path: module: fun: ({
config = lib.mkMerge [
(
if module ? config then
module.config
else
Expand All @@ -135,13 +134,13 @@ in
"options"
"imports"
]
);
imports = module.imports or [ ];
})
// {
_file = path;
options = fun module.options or { };
};
)
)
];
imports = module.imports or [ ];
_file = path;
options = lib.mkMerge [ (fun module.imports or { }) ];
});

callDefaultModule = importer moduleArgs path;
# => { config = { }; imports = [... ]; _file }
Expand Down

0 comments on commit 9096efa

Please sign in to comment.