Skip to content

Commit 9f33ab6

Browse files
committed
nixos/testing: Add support for specialArgs
Since using flakes disallows the usage of <unstable> (which I use in some tests), this adds an alternative. By setting specialArgs, all VMs can get the `unstable` flake input as an arg. This is not possible with extraConfigurations, as that would lead to infinite recursions.
1 parent 5457fc7 commit 9f33ab6

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

nixos/lib/build-vms.nix

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
minimal ? false
44
, # Ignored
55
config ? null
6-
# Nixpkgs, for qemu, lib and more
7-
, pkgs
6+
, # Nixpkgs, for qemu, lib and more
7+
pkgs
8+
, # !!! See comment about args in lib/modules.nix
9+
specialArgs ? {}
810
, # NixOS configuration to add to the VMs
911
extraConfigurations ? []
1012
}:
@@ -31,7 +33,7 @@ rec {
3133
nodes: configurations:
3234

3335
import ./eval-config.nix {
34-
inherit system;
36+
inherit system specialArgs;
3537
modules = configurations ++ extraConfigurations;
3638
baseModules = (import ../modules/module-list.nix) ++
3739
[ ../modules/virtualisation/qemu-vm.nix

nixos/lib/testing-python.nix

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
, minimal ? false
55
# Ignored
66
, config ? {}
7+
# !!! See comment about args in lib/modules.nix
8+
, specialArgs ? {}
79
# Modules to add to each VM
810
, extraConfigurations ? [] }:
911

10-
with import ./build-vms.nix { inherit system pkgs minimal extraConfigurations; };
12+
with import ./build-vms.nix { inherit system pkgs minimal specialArgs extraConfigurations; };
1113
with pkgs;
1214

1315
rec {

0 commit comments

Comments
 (0)