nix/templates/rust/flake.nix

28 lines
623 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;
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
});
};
}