MatthewCroughan / nixinate

Another NixOS Deployment Tool - Nixinate your systems 🕶️
MIT License
240 stars 32 forks source link

Hermetic cross system deployments fail #33

Open Gerschtli opened 1 year ago

Gerschtli commented 1 year ago

Currently, it is not possible to run an hermetic deployment from a x86_64-linux to an aarch64-linux machine. It fails with

/nix/store/5xr8ndqi3i7pxydh41lvx859mqfq1c0g-nixos-rebuild
/nix/store/5xr8ndqi3i7pxydh41lvx859mqfq1c0g-nixos-rebuild/bin/nixos-rebuild: line 373: /nix/store/qarssrazji0q9xp80xg8shsm2crckfr0-coreutils-9.0/bin/mktemp: cannot execute binary file: Exec format error

Hermetic deployment should copy and use cross compiled packages on the target machine.

MatthewCroughan commented 1 year ago

This is actually an issue with nixos-rebuild, which is why I was thinking of implementing multiple backends, so that we could for example choose between using nixos-rebuild and nix copy to implement the deployment, or any other method, perhaps our own custom activation.

If we use nixos-rebuild we encounter this bug https://github.com/NixOS/nixpkgs/issues/177873

If we use nix copy and use the activation script from a NixOS system closure directly, we encounter this bug https://github.com/NixOS/nixpkgs/issues/82851

Gerschtli commented 1 year ago

Ouh, that looks like fun :D If you need some help, I would be glad to join :)

MatthewCroughan commented 1 year ago

@Gerschtli Just fixing those bugs I posted would ultimately fix them in Nixinate too. I don't have the time to work on them right now, but I may find interest later on, in which case I'll give you a ping!