darwin.builder: Avoid unnecessary dependency on stateVersion

This commit is contained in:
Robert Hensing 2022-12-27 12:46:26 +01:00
parent f03c7fb8d4
commit 30548793ab

View file

@ -11,6 +11,17 @@ in
{ imports = [
../virtualisation/qemu-vm.nix
# Avoid a dependency on stateVersion
{
disabledModules = [
../virtualisation/nixos-containers.nix
../services/x11/desktop-managers/xterm.nix
];
config = {
};
options.boot.isContainer = lib.mkOption { default = false; internal = true; };
}
];
# The builder is not intended to be used interactively
@ -97,7 +108,23 @@ in
# To prevent gratuitous rebuilds on each change to Nixpkgs
nixos.revision = null;
stateVersion = "22.05";
stateVersion = lib.mkDefault (throw ''
The macOS linux builder should not need a stateVersion to be set, but a module
has accessed stateVersion nonetheless.
Please inspect the trace of the following command to figure out which module
has a dependency on stateVersion.
nix-instantiate --argstr system x86_64-darwin -A darwin.builder --show-trace
or
nix-instantiate --argstr system aarch64-darwin -A darwin.builder --show-trace
If this error occurred while evaluating the static part of the option
documentation, the problem may be fixed by adding defaultText to an option.
Otherwise, the dependency should be removed. As a last resort, stateVersion
may be hardcoded in the darwin.builder package by replacing this exception.
'');
};
users.users."${user}"= {