forked from quiK/hellorust
add flake, envrc
This commit is contained in:
49
flake.nix
49
flake.nix
@@ -1,36 +1,37 @@
|
||||
{
|
||||
description = "Rust Development Shell";
|
||||
description = "Pinned Rust dev shell";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
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
|
||||
overlays = [ (import rust-overlay) ];
|
||||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
inherit system;
|
||||
overlays = [ (import rust-overlay) ];
|
||||
};
|
||||
in
|
||||
with pkgs;
|
||||
{
|
||||
devShells.default = mkShell {
|
||||
buildInputs = [
|
||||
openssl
|
||||
pkg-config
|
||||
(
|
||||
rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
|
||||
extensions = [
|
||||
"rust-src"
|
||||
"rust-analyzer"
|
||||
];
|
||||
})
|
||||
)
|
||||
];
|
||||
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
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user