nixos/default.nix: Allow specialArgs to be passed

To allow plain nixos configrations the same power as flakes, we must
expose specialArgs, otherwise a classic pattern importing all of ones
"inputs" (i.e. npins sources), and then exposing them to the module
system becomes impossible due to the fact that imports must be
statically resolvable so these sources cannot be passed in the existing
entry point using _module.args if the sources themselves have modules to
be imported.
This commit is contained in:
Ben Edwards
2025-09-11 20:16:54 +01:00
parent 8376340a1f
commit 96acd099e1

View File

@@ -1,12 +1,15 @@
{
configuration ? import ./lib/from-env.nix "NIXOS_CONFIG" <nixos-config>,
system ? builtins.currentSystem,
# This should only be used for special arguments that need to be evaluated when resolving module structure (like in imports).
# For everything else, there's _module.args.
specialArgs ? { },
}:
let
eval = import ./lib/eval-config.nix {
inherit system;
inherit system specialArgs;
modules = [ configuration ];
};