raspberrypi #70

Merged
pim merged 5 commits from raspberrypi into master 2024-02-28 20:42:51 +00:00
2 changed files with 17 additions and 11 deletions
Showing only changes of commit 735a8a0ddf - Show all commits

View file

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

View file

@ -31,9 +31,10 @@
outputs = outputs =
{ self, nixpkgs, deploy-rs, disko, agenix, nixpkgs-unstable, dns, microvm, nixos-hardware, ... }: { self, nixpkgs, deploy-rs, disko, agenix, nixpkgs-unstable, dns, microvm, nixos-hardware, ... }:
let let
pkgs = nixpkgs.legacyPackages."x86_64-linux"; controllerArch = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${controllerArch};
lib = pkgs.lib; lib = pkgs.lib;
pkgs-unstable = nixpkgs-unstable.legacyPackages."x86_64-linux"; pkgs-unstable = nixpkgs-unstable.legacyPackages.${controllerArch};
machines = import ./nixos/machines; machines = import ./nixos/machines;
physicalMachines = lib.filterAttrs (n: v: v.type == "physical") machines; physicalMachines = lib.filterAttrs (n: v: v.type == "physical") machines;
mkNixosSystems = systemDef: mkNixosSystems = systemDef:
@ -48,7 +49,7 @@
physicalMachines; physicalMachines;
in in
{ {
devShells."x86_64-linux".default = pkgs.mkShell { devShells.${controllerArch}.default = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
libsecret libsecret
# TODO: using nixos-anywhere from nixos-unstable produces buffer overflow. # 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: { nixosConfigurations = mkNixosSystems (name: machine: {
system = machine.arch; system = machine.arch;
@ -84,17 +85,25 @@
nodes = mkDeployNodes (name: machine: { nodes = mkDeployNodes (name: machine: {
hostname = self.nixosConfigurations.${name}.config.networking.fqdn; hostname = self.nixosConfigurations.${name}.config.networking.fqdn;
profiles.system = { profiles.system = {
remoteBuild = machine.arch != "x86_64-linux"; remoteBuild = machine.arch != controllerArch;
path = deploy-rs.lib."${machine.arch}".activate.nixos path = deploy-rs.lib."${machine.arch}".activate.nixos
self.nixosConfigurations.${name}; self.nixosConfigurations.${name};
}; };
}); });
}; };
# TODO: Currently flake checks for Raspberry Pi are broken. # Deploy-rs' flake checks seem broken for architectures different from the deployment machine.
# Temporarily use --skip-checks until this is resolved. # We skip these here.
checks = builtins.mapAttrs 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; deploy-rs.lib;
}; };
} }