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.
25 lines
580 B
Nix
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;
|
|
}
|