diff options
| author | seth <[email protected]> | 2023-11-28 21:43:51 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-11-28 21:43:51 -0500 |
| commit | 6dddb6d11b95496a360b5c820447325996cd9291 (patch) | |
| tree | 8ecfbe97a13d93bd007c042a19ca448a6611a95d | |
| parent | 27dbb18788d807117b4ab2ab3c63713460665c1f (diff) | |
flake: add IDE support to dev shell
| -rw-r--r-- | .envrc | 12 | ||||
| -rw-r--r-- | parts/dev.nix | 6 |
2 files changed, 14 insertions, 4 deletions
@@ -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}"; }; }; |
