2024-04-20 03:37:05 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
|
2024-07-10 17:08:53 +02:00
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
|
|
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2024-04-20 03:37:05 +02:00
|
|
|
|
2024-07-10 17:08:53 +02:00
|
|
|
outputs = { self, nixpkgs, rust-overlay }@inputs:
|
2024-04-20 03:37:05 +02:00
|
|
|
let
|
|
|
|
systems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
2024-07-10 17:08:53 +02:00
|
|
|
"x86_64-darwin"
|
2024-04-20 03:37:05 +02:00
|
|
|
"aarch64-darwin"
|
2024-07-10 17:08:53 +02:00
|
|
|
"armv7l-linux"
|
2024-04-20 03:37:05 +02:00
|
|
|
];
|
|
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
2024-07-10 17:08:53 +02:00
|
|
|
(import rust-overlay)
|
2024-04-20 03:37:05 +02:00
|
|
|
];
|
|
|
|
};
|
2024-07-10 17:08:53 +02:00
|
|
|
|
|
|
|
rust-bin = rust-overlay.lib.mkRustBin { } pkgs.buildPackages;
|
|
|
|
toolchain = rust-bin.stable.latest.default;
|
2024-04-20 03:37:05 +02:00
|
|
|
in f system pkgs toolchain);
|
|
|
|
in {
|
|
|
|
devShell = forAllSystems (system: pkgs: toolchain: pkgs.mkShell {
|
2024-07-10 17:08:53 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
toolchain
|
2024-04-20 04:17:16 +02:00
|
|
|
pkgs.pkg-config
|
2024-04-20 03:37:05 +02:00
|
|
|
];
|
2024-07-10 17:08:53 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.openssl
|
|
|
|
];
|
|
|
|
|
|
|
|
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
|
2024-04-20 03:37:05 +02:00
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|