!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

573 Members
125 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
25 Nov 2025
@artturin:matrix.orgArtturin

My buildSystem is currently Ubuntu, so I can't just flip the nixos switch for binfmt emulation. I could probably apply the binfmt config manually if I want to go the emulation route, right?

Yup binfmt is possible to setup on all distros

18:38:09
@artturin:matrix.orgArtturin

Ideally I could use the cache and cross compile only if needed, but it looks like I can't do that without manually choosing specific packages to be cross compiled with pkgsCross attributes in the first method, right? And if I did want this, then my buildSystem would need to support emulation, right?

Can't automatically pick the packages to get from the cache and which to cross-compile. You can however make a second native nixpkgs instance to pick packages from

18:40:19
@artturin:matrix.orgArtturin *

Ideally I could use the cache and cross compile only if needed, but it looks like I can't do that without manually choosing specific packages to be cross compiled with pkgsCross attributes in the first method, right? And if I did want this, then my buildSystem would need to support emulation, right?

Can't automatically pick the packages to get from the cache and which to cross-compile. You can however make a second native nixpkgs instance to pick packages from, you could even overlay them.

18:40:29
@ebnull:matrix.orgeb

Can't automatically pick the packages to get from the cache and which to cross-compile.

Could I introspect the cache somehow (outside of nix, ahead of time) and add a nixpkgs overlay based on pname to select between ( native | cross ), hoping that the hashes will then match?

18:43:18
@ebnull:matrix.orgeb

You can however make a second native nixpkgs instance to pick packages from, you could even overlay them.

If I do set up binfmt emulation, and I'm using a stable nixos branch that hydra has cached, and not building custom packages, should I expect a 99% cache hit rate, and then the last bit is essentially making the sdcard images which I'd need to do locally?

18:44:51
@ebnull:matrix.orgeb(also I haven't said this yet - thank you for your help!)18:45:24
@artturin:matrix.orgArtturinnix-forecast for a specific installable status https://github.com/getchoo/nix-forecast hydra-check for general status https://github.com/nix-community/hydra-check18:46:20
@artturin:matrix.orgArtturinCould probably make something with those18:46:29
@artturin:matrix.orgArtturin The pkgs instance of a config can be accessed like this nixosConfigurations.ArtDesktop.pkgs.hello 18:48:06

Show newer messages


Back to Room ListRoom Version: 6