Files
nixpkgs/nixos/default.nix
Ben Edwards 96acd099e1 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.
2025-11-09 11:19:09 +00:00

25 lines
580 B
Nix

{
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 specialArgs;
modules = [ configuration ];
};
in
{
inherit (eval) pkgs config options;
system = eval.config.system.build.toplevel;
inherit (eval.config.system.build) vm vmWithBootLoader;
}