dev-templates/rust-toolchain/flake.nix

46 lines
968 B
Nix
Raw Normal View History

2022-10-20 16:14:56 +02:00
{
description = "A Nix-flake-based Rust development environment";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs =
{ self
, flake-utils
, nixpkgs
, rust-overlay
}:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [
(import rust-overlay)
(self: super: {
rustToolchain = super.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
})
];
pkgs = import nixpkgs { inherit system overlays; };
in
{
devShells.default = pkgs.mkShell {
2023-02-15 01:20:41 +01:00
packages = with pkgs; [
2022-10-20 16:14:56 +02:00
rustToolchain
openssl
pkg-config
cargo-deny
cargo-edit
2022-10-28 02:45:13 +02:00
cargo-watch
2022-10-20 16:14:56 +02:00
rust-analyzer
2022-10-28 02:45:13 +02:00
];
2022-10-20 16:14:56 +02:00
shellHook = ''
${pkgs.rustToolchain}/bin/cargo --version
'';
};
});
}