Commit Graph

3 Commits

Author SHA1 Message Date
Kazuki Yamada 6e9a9e194f refactor(nix): Drop package output, keep dev shell only
intent(nix-scope): match ccusage's flake style — provide a development environment for Nix users without taking on the maintenance burden of a packaged CLI
rejected(buildNpmPackage): npmDepsHash must be regenerated whenever package-lock.json changes; without CI to catch the mismatch, every dependency bump silently breaks `nix run github:yamadashy/repomix` for end users following the README
constraint(issue-416): #416 (Nix install method) is no longer addressed by this PR — it stays open and can be revisited via importNpmLock or nixpkgs submission later
decision(devshell-only): avoids the entire fixed-output-derivation hash dance — flake.lock alone (only nixpkgs pinned) is sufficient for reproducibility of the dev shell
2026-05-01 00:20:31 +09:00
Kazuki Yamada a747f4ef49 feat(nix): Package repomix with buildNpmPackage
intent(nix): make `nix run github:yamadashy/repomix` and `nix profile install` work, addressing #416
decision(nix-package): buildNpmPackage from nixpkgs — runs `npm ci --ignore-scripts` then the build script in one shot
decision(version-source): inherit version from package.json via fromJSON instead of hardcoding to keep flake in sync with releases
constraint(npm-deps-hash): npmDepsHash must be regenerated whenever package-lock.json changes — without it the package fixed-output derivation fails
learned(tree-sitter-wasm): the existing `require.resolve('@repomix/tree-sitter-wasms/out/...')` resolves correctly inside Nix's node_modules layout — no extra wrapping needed
learned(buildNpmPackage): default behavior puts everything under $out/lib/node_modules/repomix and symlinks bin/repomix.cjs to $out/bin — the `prepare` script is skipped via --ignore-scripts so the explicit `npm run build` in buildPhase is what produces lib/
2026-04-30 23:48:54 +09:00
Kazuki Yamada 6984d4458a feat(nix): Add flake with development shell
intent(nix): provide reproducible dev environment for Nix users without requiring NixOS
decision(nix-flake-style): inline forAllSystems via lib.genAttrs + lib.systems.flakeExposed instead of pulling in flake-utils
rejected(flake-utils): adds an extra input for trivial system iteration — modern flakes prefer no dependency for this
decision(nix-shell): mkShellNoCC over mkShell — no C compiler needed for npm-based development
decision(node-version): nodejs_24 to match .tool-versions (24.14.0) used by CI, not Dockerfile's node:22-slim
constraint(nix-formatter): pkgs.nixfmt is the canonical name now — pkgs.nixfmt-rfc-style emits a deprecation warning
learned(nix-fish): official installer skips fish setup; users need to source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish from conf.d
2026-04-30 23:37:37 +09:00