module/lib: try to pass specialArgs to eval
-{ config, lib, pkgs, baseModules, modules, ... }:
+args@{ config, lib, pkgs, baseModules, modules, ... }:
let
# Keep modules from this eval around
@@ -26,6 +26,9 @@ in
# to use `builtins.currentSystem`.
inherit system;
inherit baseModules;
+ # Newer versions of module system pass specialArgs to modules, so try
+ # to pass that to eval if possible.
+ specialArgs = args.specialArgs or { };
# Merge in this eval's modules with the argument's modules, and finally
# with the given config.
modules = modules' ++ modules ++ [ config ];
