nix/templates/rust/flake.nix
2024-03-19 10:25:29 -05:00

36 lines
739 B
Nix

{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = {
self,
nixpkgs,
}: let
inherit (self) outputs;
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
in {
devShells = forEachSupportedSystem (system: let
pkgs = import nixpkgs {inherit system;};
in {
rust-dev = pkgs.mkShell {
buildInputs = with pkgs; [
cargo
rustc
rustfmt
rustPackages.clippy
rust-analyzer
lldb
pkg-config
];
};
default = outputs.devShells.${system}.rust-dev;
});
};
}