From d4c352a402aec1682625144c0440ca31c232ee74 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 12 Nov 2026 02:15:26 +0000 Subject: tests: add edge cases of flakes A new test, edge-cases, covers paths that work but have no scenario yet: a flake given by an indirect reference, which the target fetches by its locked reference; a remote flake in a subdirectory; a flake in a subdirectory drawing inputs from sources; a dirty Git work tree; a flake whose lock file needs updating; drawing inputs from a source that isn't a directory; nested names of missing inputs; several sources sharing one flake; and an input locked to a path that the target has. The deploying machine gets a registry entry for the indirect reference. Resolving it fails if the global registry can't be downloaded, which it can't in the VM, and disabling the global registry with flake-registry needs flakes, so the deploying machine enables them, like any deploying machine using indirect references does. The target doesn't, so checks for flake support on targets still mean something. --- tests/vm.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/vm.nix') diff --git a/tests/vm.nix b/tests/vm.nix index 78b861b..d808dd2 100644 --- a/tests/vm.nix +++ b/tests/vm.nix @@ -64,6 +64,12 @@ in pkgs.testers.runNixOSTest { pkgs.age pkgs.gnupg pkgs.pass pkgs.passage ]; networking.firewall.allowedTCPPorts = [ 8000 9418 ]; + # Resolving indirect references fails if the global registry can't be + # downloaded, which it can't in the VM. Disabling it needs flakes, and a + # deploying machine using indirect references has them anyway. The + # target doesn't, so its checks for flake support still mean something. + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.flake-registry = ""; programs.ssh.extraConfig = '' StrictHostKeyChecking no UserKnownHostsFile /dev/null -- cgit v1.3.1