nix/templates/rust/flake.nix

36 lines
739 B
Nix
Raw Normal View History

2023-12-19 10:33:43 -06:00
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2023-12-19 10:33:43 -06:00
outputs = {
self,
nixpkgs,
}: let
2023-12-19 10:41:50 -06:00
inherit (self) outputs;
2024-03-19 10:25:29 -05:00
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
2023-12-19 10:41:50 -06:00
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
2023-12-19 10:33:43 -06:00
in {
2023-12-19 10:41:50 -06:00
devShells = forEachSupportedSystem (system: let
pkgs = import nixpkgs {inherit system;};
in {
rust-dev = pkgs.mkShell {
2023-12-19 10:33:43 -06:00
buildInputs = with pkgs; [
cargo
rustc
rustfmt
rustPackages.clippy
rust-analyzer
2024-03-19 10:25:29 -05:00
lldb
pkg-config
2023-12-19 10:33:43 -06:00
];
};
2023-12-19 10:41:50 -06:00
default = outputs.devShells.${system}.rust-dev;
2023-12-19 10:33:43 -06:00
});
};
}