diff --git a/pkgs/clan-cli/clan_cli/tests/fixtures_flakes.py b/pkgs/clan-cli/clan_cli/tests/fixtures_flakes.py index be434265a..e79371074 100644 --- a/pkgs/clan-cli/clan_cli/tests/fixtures_flakes.py +++ b/pkgs/clan-cli/clan_cli/tests/fixtures_flakes.py @@ -498,8 +498,18 @@ def vm_test_flake( template_path = Path(__file__).parent / "vm_test_flake.nix" template_content = template_path.read_text() - # Substitute the clan-core URL + # Get the current system + system_result = sp.run( + nix_command(["config", "show", "system"]), + capture_output=True, + text=True, + check=True, + ) + current_system = system_result.stdout.strip() + + # Substitute the clan-core URL and system flake_content = template_content.replace("__CLAN_CORE__", clan_core_url) + flake_content = flake_content.replace("__SYSTEM__", current_system) # Write the flake.nix (test_flake_dir / "flake.nix").write_text(flake_content) diff --git a/pkgs/clan-cli/clan_cli/tests/flake-module.nix b/pkgs/clan-cli/clan_cli/tests/flake-module.nix index c8835a0e7..a60bf8e37 100644 --- a/pkgs/clan-cli/clan_cli/tests/flake-module.nix +++ b/pkgs/clan-cli/clan_cli/tests/flake-module.nix @@ -2,11 +2,21 @@ { # Define machines that use the nixOS modules clan.machines = { - test-vm-persistence = { + test-vm-persistence-x86_64-linux = { imports = [ self.nixosModules.test-vm-persistence ]; + nixpkgs.hostPlatform = "x86_64-linux"; }; - test-vm-deployment = { + test-vm-persistence-aarch64-linux = { + imports = [ self.nixosModules.test-vm-persistence ]; + nixpkgs.hostPlatform = "aarch64-linux"; + }; + test-vm-deployment-x86_64-linux = { imports = [ self.nixosModules.test-vm-deployment ]; + nixpkgs.hostPlatform = "x86_64-linux"; + }; + test-vm-deployment-aarch64-linux = { + imports = [ self.nixosModules.test-vm-deployment ]; + nixpkgs.hostPlatform = "aarch64-linux"; }; }; @@ -15,7 +25,6 @@ test-vm-persistence = { config, ... }: { - nixpkgs.hostPlatform = "x86_64-linux"; system.stateVersion = config.system.nixos.release; # Disable services that might cause issues in tests @@ -53,7 +62,6 @@ test-vm-deployment = { config, lib, ... }: { - nixpkgs.hostPlatform = "x86_64-linux"; system.stateVersion = config.system.nixos.release; # Disable services that might cause issues in tests diff --git a/pkgs/clan-cli/clan_cli/tests/vm_test_flake.nix b/pkgs/clan-cli/clan_cli/tests/vm_test_flake.nix index 7a6aa25a8..10676624d 100644 --- a/pkgs/clan-cli/clan_cli/tests/vm_test_flake.nix +++ b/pkgs/clan-cli/clan_cli/tests/vm_test_flake.nix @@ -10,9 +10,11 @@ machines = { test-vm-persistence = { imports = [ clan-core.nixosModules.test-vm-persistence ]; + nixpkgs.hostPlatform = "__SYSTEM__"; }; test-vm-deployment = { imports = [ clan-core.nixosModules.test-vm-deployment ]; + nixpkgs.hostPlatform = "__SYSTEM__"; }; }; }; diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index 1bf64f382..ae76a006a 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -244,8 +244,8 @@ pythonRuntime.pkgs.buildPythonApplication { pkgs.libxslt pkgs.getconf - nixosConfigurations.test-vm-persistence.config.system.clan.vm.create - nixosConfigurations.test-vm-deployment.config.system.clan.vm.create + nixosConfigurations."test-vm-persistence-${stdenv.hostPlatform.system}".config.system.clan.vm.create + nixosConfigurations."test-vm-deployment-${stdenv.hostPlatform.system}".config.system.clan.vm.create ]; }; }