This gist shows an overlay that can be applied to the Nix Kismet package to enable cross-compiling with pkgsCross. It also provides a modified Kismet packages with the applied changes.
NOTE: This gist is now obselete, issue was resolved with this PR: NixOS/nixpkgs#276038
QEMU is required to emulate some of the tools in the build environment (pkg-config, protoc, protoc-c). On Debian based systems install with:
sudo apt -y install qemu-user-static
And then check that aarch64 is being emulated with:
ls -l /proc/sys/fs/binfmt_misc | grep aarch64
On NixOS add:
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
To your system config, and rebuild.
Apply the kismet.nix contents to nixpkgs/applications/networking/sniffers/kismet/default.nix and build the modified package with .#pkgsCross.aarch64-multiplatform.kismet from the Nixpkgs root directory, or apply the overlay to your existing project's kismet package.
I just spent the past 12 hours of my life figuring out the 3 lines of code (ok technically 5) that need to be added to the Nixpkgs kismet package source to enable cross-compiling Kismet on an x86_64-linux platform for an aarch64-linux target with nix build .#pkgsCross.aarch64-multiplatform.kismet .
First, I don't need Python so I change the default input to false. Someone else can figure out how to fix that.
For whatever reason, even though pkg-config seems to be detected fine by the configure script initially, later in the script (starting around line 11000) when it goes to configure cflags and libraries it is no longer in the path and throws a "command not found" error. This will result in a failed build starting with failed protobuf library linking and undefined reference to `protobuf_c_message_get_packed_size' and other protobuf functions.
The --with-protoc and --with-protocc flags were much easier and more obvious fixes, though I'm not sure why they can't be found when the other build inputs can be.