Files
hellorust/flake.nix
2025-08-10 11:22:05 +02:00

38 lines
962 B
Nix

{
description = "Pinned Rust dev shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, rust-overlay, ... }:
let
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
rustToolchain = pkgs.rust-bin.stable."1.89.0".default.override {
extensions = [ "rust-src" "rust-analyzer" ];
};
in f pkgs rustToolchain
);
in {
devShells = forAllSystems (pkgs: rustToolchain: {
default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.pkg-config
rustToolchain
pkgs.lldb
];
buildInputs = [
pkgs.openssl
];
};
});
};
}