-
-
Notifications
You must be signed in to change notification settings - Fork 60
/
flake.nix
45 lines (42 loc) · 1.12 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Example flake for `nix develop`.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
rust-overlay,
nixpkgs,
}:
{
devShells.x86_64-linux.default =
let
pkgsCross = nixpkgs.legacyPackages.x86_64-linux.pkgsCross.aarch64-multiplatform;
rust-bin = rust-overlay.lib.mkRustBin { } pkgsCross.buildPackages;
in
pkgsCross.callPackage (
{
mkShell,
pkg-config,
qemu,
openssl,
stdenv,
}:
mkShell {
nativeBuildInputs = [
rust-bin.stable.latest.minimal
pkg-config
];
depsBuildBuild = [ qemu ];
buildInputs = [ openssl ];
env = {
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = "${stdenv.cc.targetPrefix}cc";
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER = "qemu-aarch64";
};
}
) { };
};
}