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}"; +}