mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 23:54:01 +00:00
b8698cd8d6
Closes #193336 Closes #261694 Related to #108984 The goal here was to get the following flake to build and run on `aarch64-darwin`: ```nix { inputs.nixpkgs.url = <this branch>; outputs = { nixpkgs, ... }: { checks.aarch64-darwin.default = nixpkgs.legacyPackages.aarch64-darwin.nixosTest { name = "test"; nodes.machine = { }; testScript = ""; }; }; } ``` … and after this change it does. There's no longer a need for the user to set `nodes.*.nixpkgs.pkgs` or `nodes.*.virtualisation.host.pkgs` as the correct values are inferred from the host system.
16 lines
667 B
Nix
16 lines
667 B
Nix
{ config, lib, hostPkgs, ... }:
|
|
{
|
|
config = {
|
|
# default pkgs for use in VMs
|
|
_module.args.pkgs =
|
|
# TODO: deprecate it everywhere; not just on darwin. Throw on darwin?
|
|
lib.warnIf hostPkgs.stdenv.hostPlatform.isDarwin
|
|
"Do not use the `pkgs` module argument in tests you want to run on darwin. It is ambiguous, and many tests are broken because of it. If you need to use a package on the VM host, use `hostPkgs`. Otherwise, use `config.node.pkgs`, or `config.nodes.<name>.nixpkgs.pkgs`."
|
|
hostPkgs;
|
|
|
|
defaults = {
|
|
# TODO: a module to set a shared pkgs, if options.nixpkgs.* is untouched by user (highestPrio) */
|
|
};
|
|
};
|
|
}
|