2024-04-18 21:33:02 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
fenix.url = "github:nix-community/fenix";
|
|
|
|
fenix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, fenix }@inputs:
|
2024-05-05 14:05:33 +02:00
|
|
|
let
|
2024-04-18 21:33:02 +02:00
|
|
|
systems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
2024-05-05 14:05:33 +02:00
|
|
|
"x86_64-darwin"
|
2024-04-18 21:33:02 +02:00
|
|
|
"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);
|
|
|
|
in {
|
|
|
|
devShell = forAllSystems (system: pkgs: toolchain: pkgs.mkShell {
|
|
|
|
packages = [
|
|
|
|
(toolchain.withComponents [
|
2024-05-01 22:22:11 +02:00
|
|
|
"cargo" "rustc" "rustfmt" "clippy" "llvm-tools"
|
2024-04-18 21:33:02 +02:00
|
|
|
])
|
|
|
|
pkgs.mpv
|
2024-05-01 22:22:11 +02:00
|
|
|
pkgs.grcov
|
2024-05-04 13:50:39 +02:00
|
|
|
pkgs.cargo-nextest
|
2024-04-18 21:33:02 +02:00
|
|
|
];
|
2024-05-05 14:05:33 +02:00
|
|
|
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
|
2024-04-18 21:33:02 +02:00
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|