From f3f7e075f67014e3af1e60d051e5f9ed8937271d Mon Sep 17 00:00:00 2001 From: aditya Date: Tue, 27 Jun 2023 20:25:48 +0530 Subject: [PATCH] add rust flake --- flake-rust.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 flake-rust.nix diff --git a/flake-rust.nix b/flake-rust.nix new file mode 100644 index 0000000..f5c98d5 --- /dev/null +++ b/flake-rust.nix @@ -0,0 +1,30 @@ +# in flake.nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + }; + outputs = { self, nixpkgs, flake-utils, rust-overlay }: + flake-utils.lib.eachDefaultSystem + (system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { + inherit system overlays; + }; + in + with pkgs; + { + devShells.default = mkShell { + buildInputs = with pkgs; [rustc cargo]; + }; + } + ); +}