diff --git a/lib/build-clan/auto-imports.nix b/lib/build-clan/auto-imports.nix deleted file mode 100644 index aee5afced..000000000 --- a/lib/build-clan/auto-imports.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - lib, - self, - ... -}: - -let - # Returns an attrset with inputs that have the attribute `clanModules` - inputsWithClanModules = lib.filterAttrs ( - _name: value: builtins.hasAttr "clanModules" value - ) self.inputs; - - flattenedClanModules = lib.foldl' ( - acc: input: - lib.mkMerge [ - acc - input.clanModules - ] - ) { } (lib.attrValues inputsWithClanModules); -in -{ - inventory.modules = flattenedClanModules; -} diff --git a/lib/build-clan/module.nix b/lib/build-clan/module.nix index 47ab17d0d..f4bd10d58 100644 --- a/lib/build-clan/module.nix +++ b/lib/build-clan/module.nix @@ -168,18 +168,6 @@ let in { imports = [ - # Temporarily disable auto-imports since the type of the modules is not a plain path anymore we cant "merge" multiple definitions - # That this feature worked previously seems like a coincidence. - # TODO(@Qubasa): make sure modules are not imported twice. - # Example error: - # The option `inventory.modules.admin' is defined multiple times while it's expected to be unique. - # - In `/nix/store/a0iqxl7r1spqsf2b886kn3i5sj8p37nc-source/lib/build-clan/auto-imports.nix': /nix/store/a0iqxl7r1spqsf2b886kn3i5sj8p37nc-source/clanModules/admin - # - In `/nix/store/a0iqxl7r1spqsf2b886kn3i5sj8p37nc-source/lib/build-clan/module.nix': /nix/store/a0iqxl7r1spqsf2b886kn3i5sj8p37nc-source/clanModules/admin - # - # After the inventory refactoring we might not need this anymore - # People can just import the module they want to use: `module = { input = "inputName"; name = "moduleName"; };` - # ./auto-imports.nix - # Merge the inventory file { inventory = _: {