How to install nix package manager on Raspbian?


Hi all,

I’d like to play with Nix on my Raspberry Pi, but have already installed and set up Raspbian. Because of this I would like to just install the the package manager.

For a long shot I just tried running the install instructions from, but was told there was no binary distribution for my platform. I can see the RPi is supported in some form from

Is there a way to just get the package manager for ARM/RPi?



If I remember correctly, for armv7l the only way to get Nix would be to compile it from the source, and compiling from source requires a patch for armv7l.


This used to work, not sure anymore:


Thanks for the answers!

@eadwu Is there a way to set up a cross-compile environment?

@tom I’m unsure how to use the code on that page, do you have any pointers?


There’s been some very recent work on getting cross-compilation working well for NixOS. I was able to use this configuration to cross-compile to a Raspberry Pi Zero W:


Thanks you! It looks like that code will cross-compile all of NixOS? Do you have any pointers for just compiling the Nix package manager?


I haven’t tried it but taking the crossSystem part might be enough:

  lib =
    (import <nixpkgs> { }).lib;
  crossPkgs =
    import <nixpkgs> {
      crossSystem =;


This is not easy to do right now. Someone had a PR to make this easier here:

But it hasn’t been reviewed, and I’m a little bit hesitant to merge it as is. If anyone can review that, it would make this process much easier! We could add it as a job for cross-trunk, and you would just download it from:

Unfortunately Nix is broken right now in cross-trunk:

Any fixes for that would be greatly appreciated!


It seems that adding libatomic_ops as a dependency was all that was needed to cross-compile Nix (or at least finish the build)? Though I’m not sure how the conditional would look like since it seems native compilation works fine without it.

~ took 1m 36s
➜ nix build -f "<nixpkgs>" pkgsCross.raspberryPi.nix
[1 built, 2 copied (0.6 MiB), 0.1 MiB DL]

~ took 1m 49s
➜ nix build -f "<nixpkgs>" pkgsCross.aarch64-multiplatform.nix
[25 built, 22 copied (927.7 MiB), 180.5 MiB DL]

~ took 16m 9s