vms: also prebuild for aarch64
This commit is contained in:
@@ -498,8 +498,18 @@ def vm_test_flake(
|
|||||||
template_path = Path(__file__).parent / "vm_test_flake.nix"
|
template_path = Path(__file__).parent / "vm_test_flake.nix"
|
||||||
template_content = template_path.read_text()
|
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 = template_content.replace("__CLAN_CORE__", clan_core_url)
|
||||||
|
flake_content = flake_content.replace("__SYSTEM__", current_system)
|
||||||
|
|
||||||
# Write the flake.nix
|
# Write the flake.nix
|
||||||
(test_flake_dir / "flake.nix").write_text(flake_content)
|
(test_flake_dir / "flake.nix").write_text(flake_content)
|
||||||
|
|||||||
@@ -2,11 +2,21 @@
|
|||||||
{
|
{
|
||||||
# Define machines that use the nixOS modules
|
# Define machines that use the nixOS modules
|
||||||
clan.machines = {
|
clan.machines = {
|
||||||
test-vm-persistence = {
|
test-vm-persistence-x86_64-linux = {
|
||||||
imports = [ self.nixosModules.test-vm-persistence ];
|
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 ];
|
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 =
|
test-vm-persistence =
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
|
||||||
system.stateVersion = config.system.nixos.release;
|
system.stateVersion = config.system.nixos.release;
|
||||||
|
|
||||||
# Disable services that might cause issues in tests
|
# Disable services that might cause issues in tests
|
||||||
@@ -53,7 +62,6 @@
|
|||||||
test-vm-deployment =
|
test-vm-deployment =
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
|
||||||
system.stateVersion = config.system.nixos.release;
|
system.stateVersion = config.system.nixos.release;
|
||||||
|
|
||||||
# Disable services that might cause issues in tests
|
# Disable services that might cause issues in tests
|
||||||
|
|||||||
@@ -10,9 +10,11 @@
|
|||||||
machines = {
|
machines = {
|
||||||
test-vm-persistence = {
|
test-vm-persistence = {
|
||||||
imports = [ clan-core.nixosModules.test-vm-persistence ];
|
imports = [ clan-core.nixosModules.test-vm-persistence ];
|
||||||
|
nixpkgs.hostPlatform = "__SYSTEM__";
|
||||||
};
|
};
|
||||||
test-vm-deployment = {
|
test-vm-deployment = {
|
||||||
imports = [ clan-core.nixosModules.test-vm-deployment ];
|
imports = [ clan-core.nixosModules.test-vm-deployment ];
|
||||||
|
nixpkgs.hostPlatform = "__SYSTEM__";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -244,8 +244,8 @@ pythonRuntime.pkgs.buildPythonApplication {
|
|||||||
pkgs.libxslt
|
pkgs.libxslt
|
||||||
pkgs.getconf
|
pkgs.getconf
|
||||||
|
|
||||||
nixosConfigurations.test-vm-persistence.config.system.clan.vm.create
|
nixosConfigurations."test-vm-persistence-${stdenv.hostPlatform.system}".config.system.clan.vm.create
|
||||||
nixosConfigurations.test-vm-deployment.config.system.clan.vm.create
|
nixosConfigurations."test-vm-deployment-${stdenv.hostPlatform.system}".config.system.clan.vm.create
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user