Init
This commit is contained in:
1
rust/.envrc
Normal file
1
rust/.envrc
Normal file
@@ -0,0 +1 @@
|
||||
use flake
|
||||
40
rust/flake.nix
Normal file
40
rust/flake.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
description = "Rust dev shell";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
allSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
});
|
||||
in
|
||||
{
|
||||
devShells = forAllSystems ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
cargo
|
||||
rustc
|
||||
rustfmt
|
||||
rust-analyzer
|
||||
clippy
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo "<rust dev shell>"
|
||||
echo "Cargo version: $(cargo --version)"
|
||||
echo "Rustc version: $(rustc --version)"
|
||||
'';
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user