From 52d9a479cf6ba7e3ad77e16a4e999148029e418e Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 5 Aug 2024 03:48:51 +0300 Subject: [PATCH] additional nix tooling --- .envrc | 5 +++++ flake.nix | 4 ++++ nix/shell.nix | 25 +++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 .envrc create mode 100644 nix/shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..9e15f92 --- /dev/null +++ b/.envrc @@ -0,0 +1,5 @@ +watch_file flake.nix +watch_file flake.lock +watch_dir nix + +use flake diff --git a/flake.nix b/flake.nix index 4ee4f5f..b5035c3 100644 --- a/flake.nix +++ b/flake.nix @@ -13,5 +13,9 @@ packages = forEachSystem (system: { default = pkgsForEach.${system}.callPackage ./nix/package.nix {}; }); + + devShells = forEachSystem (system: { + default = pkgsForEach.${system}.callPackage ./nix/shell.nix {}; + }); }; } diff --git a/nix/shell.nix b/nix/shell.nix new file mode 100644 index 0000000..5efe65c --- /dev/null +++ b/nix/shell.nix @@ -0,0 +1,25 @@ +{ + mkShell, + rust-analyzer-unwrapped, + rustfmt, + clippy, + cargo, + rustc, + gcc, + rustPlatform, +}: +mkShell { + strictDeps = true; + + nativeBuildInputs = [ + cargo + rustc + gcc + + rust-analyzer-unwrapped + rustfmt + clippy + ]; + + env.RUST_SRC_PATH = "${rustPlatform.rustLibSrc}"; +}