create submodule design pattern

This commit is contained in:
Emile Clark-Boman 2025-12-13 22:00:34 +10:00
parent c282633fb5
commit 831203ecce

View file

@ -1,4 +1,12 @@
builtins.listToAttrs [
(import ./attrs.nix)
(import ./lists.nix)
]
{}: let
attrs = import ./attrs.nix {inherit lists;};
lists = import ./lists.nix {};
result = import ./lists.nix {inherit lists;};
in
builtins.listToAttrs [
# submodule is included directly to this module (ie self.myFunc)
# submodule content is accessible first by submodule name
# then by the name of the content (ie self.submodule.myFunc)
{inherit attrs lists result;}
]