greg-ng/flake.nix

41 lines
982 B
Nix
Raw Permalink Normal View History

2024-04-18 22:03:35 +02:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
2024-04-18 22:03:35 +02:00
outputs = { self, nixpkgs, rust-overlay }:
let
2024-04-18 22:03:35 +02:00
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
2024-04-18 22:03:35 +02:00
"aarch64-darwin"
"armv7l-linux"
2024-04-18 22:03:35 +02:00
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
(import rust-overlay)
2024-04-18 22:03:35 +02:00
];
};
rust-bin = rust-overlay.lib.mkRustBin { } pkgs.buildPackages;
toolchain = rust-bin.stable.latest.default;
2024-04-18 22:03:35 +02:00
in f system pkgs toolchain);
in {
devShells = forAllSystems (system: pkgs: toolchain: {
default = pkgs.mkShell {
nativeBuildInputs = [
toolchain
pkgs.mpv
];
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
};
2024-04-18 22:03:35 +02:00
});
};
}