2024-03-03 06:11:13 +01:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
fenix.url = "github:nix-community/fenix";
|
|
|
|
fenix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-05-26 03:53:16 +02:00
|
|
|
|
|
|
|
outputs = { self, nixpkgs, fenix }@inputs:
|
2024-03-03 06:11:13 +01:00
|
|
|
let
|
2024-05-26 03:53:16 +02:00
|
|
|
systems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"aarch64-darwin"
|
|
|
|
];
|
|
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: let
|
|
|
|
toolchain = fenix.packages.${system}.complete;
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [
|
|
|
|
(_: super: let pkgs = fenix.inputs.nixpkgs.legacyPackages.${system}; in fenix.overlays.default pkgs pkgs)
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in f system pkgs toolchain);
|
2024-03-03 06:11:13 +01:00
|
|
|
in {
|
2024-05-26 03:53:16 +02:00
|
|
|
devShell = forAllSystems (system: pkgs: toolchain: pkgs.mkShell {
|
|
|
|
packages = [
|
|
|
|
(toolchain.withComponents [
|
|
|
|
"cargo" "rustc" "rustfmt" "clippy"
|
|
|
|
])
|
|
|
|
pkgs.openssl
|
|
|
|
pkgs.pkg-config
|
2024-03-03 06:11:13 +01:00
|
|
|
];
|
2024-05-26 03:53:16 +02:00
|
|
|
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
|
|
|
|
});
|
2024-03-03 06:11:13 +01:00
|
|
|
};
|
|
|
|
}
|