skip deploy-rs flake check for architecture different from the
deployment machine
This commit is contained in:
parent
22c235f380
commit
735a8a0ddf
2 changed files with 17 additions and 11 deletions
|
@ -45,6 +45,3 @@ A workaround is to deploy the share without `deploy-rs`'s rollback feature enabl
|
|||
```
|
||||
deploy --targets .#lewis --auto-rollback false --magic-rollback false
|
||||
```
|
||||
|
||||
Currently the flake checks fail on Raspberry Pi because it tries to compile the deploy-rs binary in aarch64 format on the controller.
|
||||
This can be temporarily circumvented by using `--skip-checks`.
|
||||
|
|
25
flake.nix
25
flake.nix
|
@ -31,9 +31,10 @@
|
|||
outputs =
|
||||
{ self, nixpkgs, deploy-rs, disko, agenix, nixpkgs-unstable, dns, microvm, nixos-hardware, ... }:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||
controllerArch = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${controllerArch};
|
||||
lib = pkgs.lib;
|
||||
pkgs-unstable = nixpkgs-unstable.legacyPackages."x86_64-linux";
|
||||
pkgs-unstable = nixpkgs-unstable.legacyPackages.${controllerArch};
|
||||
machines = import ./nixos/machines;
|
||||
physicalMachines = lib.filterAttrs (n: v: v.type == "physical") machines;
|
||||
mkNixosSystems = systemDef:
|
||||
|
@ -48,7 +49,7 @@
|
|||
physicalMachines;
|
||||
in
|
||||
{
|
||||
devShells."x86_64-linux".default = pkgs.mkShell {
|
||||
devShells.${controllerArch}.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
libsecret
|
||||
# TODO: using nixos-anywhere from nixos-unstable produces buffer overflow.
|
||||
|
@ -65,7 +66,7 @@
|
|||
];
|
||||
};
|
||||
|
||||
formatter."x86_64-linux" = pkgs.nixfmt;
|
||||
formatter.${controllerArch} = pkgs.nixfmt;
|
||||
|
||||
nixosConfigurations = mkNixosSystems (name: machine: {
|
||||
system = machine.arch;
|
||||
|
@ -84,17 +85,25 @@
|
|||
nodes = mkDeployNodes (name: machine: {
|
||||
hostname = self.nixosConfigurations.${name}.config.networking.fqdn;
|
||||
profiles.system = {
|
||||
remoteBuild = machine.arch != "x86_64-linux";
|
||||
remoteBuild = machine.arch != controllerArch;
|
||||
path = deploy-rs.lib."${machine.arch}".activate.nixos
|
||||
self.nixosConfigurations.${name};
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
# TODO: Currently flake checks for Raspberry Pi are broken.
|
||||
# Temporarily use --skip-checks until this is resolved.
|
||||
# Deploy-rs' flake checks seem broken for architectures different from the deployment machine.
|
||||
# We skip these here.
|
||||
checks = builtins.mapAttrs
|
||||
(system: deployLib: deployLib.deployChecks self.deploy)
|
||||
(system: deployLib:
|
||||
deployLib.deployChecks (self.deploy // {
|
||||
nodes = (lib.attrsets.filterAttrs
|
||||
(name: node:
|
||||
machines.${name}.arch == controllerArch
|
||||
)
|
||||
self.deploy.nodes);
|
||||
})
|
||||
)
|
||||
deploy-rs.lib;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue