summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-11-28 21:43:51 -0500
committerseth <[email protected]>2023-11-28 21:43:51 -0500
commit6dddb6d11b95496a360b5c820447325996cd9291 (patch)
tree8ecfbe97a13d93bd007c042a19ca448a6611a95d
parent27dbb18788d807117b4ab2ab3c63713460665c1f (diff)
flake: add IDE support to dev shell
-rw-r--r--.envrc12
-rw-r--r--parts/dev.nix6
2 files changed, 14 insertions, 4 deletions
diff --git a/.envrc b/.envrc
index 1b6637e..dcc53e4 100644
--- a/.envrc
+++ b/.envrc
@@ -1,5 +1,11 @@
-if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
- source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
+# only use flake when `nix` is present
+if command -v nix &> /dev/null; then
+ if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
+ source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
+ fi
+
+ watch_file ./parts/dev.nix
+ use flake
fi
-use flake
+
dotenv_if_exists
diff --git a/parts/dev.nix b/parts/dev.nix
index 440fa7c..4cd51d6 100644
--- a/parts/dev.nix
+++ b/parts/dev.nix
@@ -52,12 +52,16 @@
devShells = {
default = pkgs.mkShell {
packages = with pkgs; [
+ # general
actionlint
nodePackages_latest.prettier
# rust
+ cargo
+ rustc
clippy
rustfmt
+ rust-analyzer
# nix
config.formatter
@@ -66,7 +70,7 @@
statix
];
- inputsFrom = [config.packages.default];
+ RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
};