Files
hellorust/flake.nix

38 lines
962 B
Nix
Raw Normal View History

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