Skip to content

Commit

Permalink
lib/types, lib/modules: Remove unused extensionOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Jun 14, 2022
1 parent d4a84ae commit 9dead55
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
8 changes: 1 addition & 7 deletions lib/modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ rec {
args ? {}
, # This would be remove in the future, Prefer _module.check option instead.
check ? true
# Internal variable to avoid `_key` collisions regardless
# of `extendModules`. Used in `submoduleWith`.
# Test case: lib/tests/modules, "168767"
, extensionOffset ? 0
}:
let
withWarnings = x:
Expand Down Expand Up @@ -345,17 +341,15 @@ rec {
modules ? [],
specialArgs ? {},
prefix ? [],
extensionOffset ? length modules,
}:
evalModules (evalModulesArgs // {
modules = regularModules ++ modules;
specialArgs = evalModulesArgs.specialArgs or {} // specialArgs;
prefix = extendArgs.prefix or evalModulesArgs.prefix or [];
inherit extensionOffset;
});

type = lib.types.submoduleWith {
inherit modules specialArgs extensionOffset;
inherit modules specialArgs;
};

result = withWarnings {
Expand Down
6 changes: 0 additions & 6 deletions lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,6 @@ rec {
, specialArgs ? {}
, shorthandOnlyDefinesConfig ? false
, description ? null

# Internal variable to avoid `_key` collisions regardless
# of `extendModules`. Wired through by `evalModules`.
# Test case: lib/tests/modules, "168767"
, extensionOffset ? 0
}@attrs:
let
inherit (lib.modules) evalModules;
Expand Down Expand Up @@ -623,7 +618,6 @@ rec {
(base.extendModules {
modules = [ { _module.args.name = last loc; } ] ++ allModules defs;
prefix = loc;
extensionOffset = extensionOffset + length defs;
}).config;
emptyValue = { value = {}; };
getSubOptions = prefix: (base.extendModules
Expand Down

0 comments on commit 9dead55

Please sign in to comment.