nix/templates/rust/flake.nix

28 lines
653 B
Nix
Raw Normal View History

2023-12-19 10:33:43 -06:00
{
2024-01-05 10:21:48 -06:00
inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=bd645e8668ec6612439a9ee7e71f7eac4099d4f6";
2023-12-19 10:33:43 -06:00
outputs = {
self,
nixpkgs,
}: let
2023-12-19 10:41:50 -06:00
inherit (self) outputs;
2023-12-19 10:33:43 -06:00
supportedSystems = ["x86_64-linux"];
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
];
};
2023-12-19 10:41:50 -06:00
default = outputs.devShells.${system}.rust-dev;
2023-12-19 10:33:43 -06:00
});
};
}