checks/flash: support aarch64-linux
This commit is contained in:
@@ -1,12 +1,26 @@
|
|||||||
{ self, lib, ... }:
|
|
||||||
{
|
{
|
||||||
clan.machines.test-flash-machine = {
|
config,
|
||||||
clan.core.networking.targetHost = "test-flash-machine";
|
self,
|
||||||
fileSystems."/".device = lib.mkDefault "/dev/vda";
|
lib,
|
||||||
boot.loader.grub.device = lib.mkDefault "/dev/vda";
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
clan.machines = lib.listToAttrs (
|
||||||
|
lib.map (
|
||||||
|
system:
|
||||||
|
lib.nameValuePair "test-flash-machine-${system}" {
|
||||||
|
clan.core.networking.targetHost = "test-flash-machine";
|
||||||
|
fileSystems."/".device = lib.mkDefault "/dev/vda";
|
||||||
|
boot.loader.grub.device = lib.mkDefault "/dev/vda";
|
||||||
|
|
||||||
imports = [ self.nixosModules.test-flash-machine ];
|
# We need to use `mkForce` because we inherit from `test-install-machine`
|
||||||
};
|
# which currently hardcodes `nixpkgs.hostPlatform`
|
||||||
|
nixpkgs.hostPlatform = lib.mkForce system;
|
||||||
|
|
||||||
|
imports = [ self.nixosModules.test-flash-machine ];
|
||||||
|
}
|
||||||
|
) (lib.filter (lib.hasSuffix "linux") config.systems)
|
||||||
|
);
|
||||||
|
|
||||||
flake.nixosModules = {
|
flake.nixosModules = {
|
||||||
test-flash-machine =
|
test-flash-machine =
|
||||||
@@ -30,21 +44,20 @@
|
|||||||
let
|
let
|
||||||
dependencies = [
|
dependencies = [
|
||||||
pkgs.disko
|
pkgs.disko
|
||||||
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-flash-machine.pkgs.perlPackages.ConfigIniFiles
|
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".pkgs.perlPackages.ConfigIniFiles
|
||||||
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-flash-machine.pkgs.perlPackages.FileSlurp
|
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".pkgs.perlPackages.FileSlurp
|
||||||
|
|
||||||
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-flash-machine.config.system.build.toplevel
|
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.toplevel
|
||||||
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-flash-machine.config.system.build.diskoScript
|
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript
|
||||||
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-flash-machine.config.system.build.diskoScript.drvPath
|
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.build.diskoScript.drvPath
|
||||||
self.clanInternals.machines.${pkgs.hostPlatform.system}.test-flash-machine.config.system.clan.deployment.file
|
self.nixosConfigurations."test-flash-machine-${pkgs.hostPlatform.system}".config.system.clan.deployment.file
|
||||||
|
|
||||||
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
|
] ++ builtins.map (i: i.outPath) (builtins.attrValues self.inputs);
|
||||||
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
|
closureInfo = pkgs.closureInfo { rootPaths = dependencies; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# Fails on `aarch64-linux` currently as some dependencies are not specified
|
checks = pkgs.lib.mkIf pkgs.stdenv.isLinux {
|
||||||
checks = pkgs.lib.mkIf (pkgs.stdenv.isLinux && !pkgs.stdenv.isAarch64) {
|
test-flash = (import ../lib/test-base.nix) {
|
||||||
flash = (import ../lib/test-base.nix) {
|
|
||||||
name = "flash";
|
name = "flash";
|
||||||
nodes.target = {
|
nodes.target = {
|
||||||
virtualisation.emptyDiskImages = [ 4096 ];
|
virtualisation.emptyDiskImages = [ 4096 ];
|
||||||
@@ -66,7 +79,7 @@
|
|||||||
testScript = ''
|
testScript = ''
|
||||||
start_all()
|
start_all()
|
||||||
|
|
||||||
machine.succeed("clan flash write --debug --flake ${../..} --yes --disk main /dev/vdb test-flash-machine")
|
machine.succeed("clan flash write --debug --flake ${../..} --yes --disk main /dev/vdb test-flash-machine-${pkgs.hostPlatform.system}")
|
||||||
'';
|
'';
|
||||||
} { inherit pkgs self; };
|
} { inherit pkgs self; };
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user