vms: also prebuild for aarch64

This commit is contained in:
Jörg Thalheim
2025-08-18 15:16:07 +02:00
parent 1850abdd0d
commit 5b1a9d6848
4 changed files with 27 additions and 7 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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__";
};
};
};

View File

@@ -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
];
};
}