From 8904a6e4e526586006dbd57fc647007dd78fd508 Mon Sep 17 00:00:00 2001 From: gildlab Date: Tue, 19 May 2026 09:45:35 +0000 Subject: [PATCH] flake: skip npm ci in default shell when lockfile already installed The default devShell ran npm ci on every entry whenever package.json was present, wiping and reinstalling node_modules even when it already matched the lockfile. Compare ./package-lock.json to the copy npm writes into ./node_modules/.package-lock.json after a successful install, and skip when they match. First entry (or any entry after the lockfile changes) still runs npm ci. Closes #175 Co-Authored-By: Claude Opus 4.7 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index f1e75b3..cb31735 100644 --- a/flake.nix +++ b/flake.nix @@ -576,7 +576,7 @@ ${pre-commit.shellHook} ${source-dotenv} - if [ -f ./package.json ]; then + if [ -f ./package.json ] && ! cmp -s ./package-lock.json ./node_modules/.package-lock.json 2>/dev/null; then npm ci --ignore-scripts; fi '';