From 0364d7df903df3b9c1f7d677c07a727eae05219c Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:03:13 +0000 Subject: [PATCH 1/4] chore(nix): remove redundant tsgolint package The tsgolint binary is bundled with the oxlint package in nixpkgs, so specifying it separately is unnecessary. This removes the duplicate from both flake.nix and CI workflow. --- .github/workflows/ci.yaml | 2 +- flake.nix | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d8b2005..4450c4c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,7 +41,7 @@ jobs: - name: Setup Nix uses: ./.github/actions/setup-nix with: - tools: nodejs_24 pnpm_10 oxlint oxfmt similarity nixfmt tsgolint + tools: nodejs_24 pnpm_10 oxlint oxfmt similarity nixfmt - name: Run Lint run: pnpm run lint diff --git a/flake.nix b/flake.nix index eb0c5a3..b85367a 100644 --- a/flake.nix +++ b/flake.nix @@ -31,7 +31,6 @@ # formatting and linting tools similarity nixfmt - tsgolint oxlint oxfmt From 8cdfa28d6cbc19d9f4416fb93f18759243fa28f9 Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:03:23 +0000 Subject: [PATCH 2/4] docs(rules): add nix-workflow rule Add comprehensive documentation for Nix usage in the project: - Development environment setup with flake.nix - CI workflow using nix profile install via setup-nix action - Tool configuration and adding new packages - Build flags for local development This helps maintain consistency when modifying Nix configuration. --- .claude/rules/nix-workflow.md | 88 +++++++++++++++++++++++++++++++++++ CLAUDE.md | 1 + 2 files changed, 89 insertions(+) create mode 100644 .claude/rules/nix-workflow.md diff --git a/.claude/rules/nix-workflow.md b/.claude/rules/nix-workflow.md new file mode 100644 index 0000000..1e734dc --- /dev/null +++ b/.claude/rules/nix-workflow.md @@ -0,0 +1,88 @@ +# Nix Workflow + +This rule provides guidance on Nix usage in the StackOne SDK. + +## Development Environment + +The project uses `flake.nix` to define the development environment with `nix develop`. + +### Adding Development Tools + +To add a new tool to the development environment, add it to `buildInputs` in `flake.nix`: + +```nix +buildInputs = with pkgs; [ + # runtime + nodejs_24 + pnpm_10 + + # formatting and linting tools + oxlint # includes tsgolint + oxfmt + + # your new tool here + new-tool +]; +``` + +## CI Workflow + +CI uses `nix profile install` via the `.github/actions/setup-nix/action.yaml` composite action. + +### Adding Tools to CI Jobs + +Specify tools in the `tools` input of the setup-nix action: + +```yaml +- name: Setup Nix + uses: ./.github/actions/setup-nix + with: + tools: nodejs_24 pnpm_10 oxlint oxfmt +``` + +The action installs packages using: + +```bash +nix profile install --inputs-from . nixpkgs#tool1 nixpkgs#tool2 +``` + +### CI Tool Configuration + +- **Default tools**: `nodejs_24 pnpm_10` (defined in action.yaml) +- **Skip pnpm install**: Set `skip-pnpm-install: 'true'` for jobs that don't need node dependencies + +### Example: Adding a New Tool to Lint Job + +```yaml +lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup Nix + uses: ./.github/actions/setup-nix + with: + tools: nodejs_24 pnpm_10 oxlint oxfmt new-tool + - name: Run Lint + run: pnpm run lint +``` + +## Build Flags + +Always use these flags when running Nix build commands locally: + +```bash +--print-build-logs --show-trace +``` + +Example: + +```bash +nix build --print-build-logs --show-trace +nix flake check --print-build-logs --show-trace +``` + +## Notes + +- Some packages bundle multiple tools (e.g., `oxlint` includes `tsgolint`) +- Check nixpkgs for package contents before adding redundant dependencies diff --git a/CLAUDE.md b/CLAUDE.md index e5b0871..404e78a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,6 +15,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co | **pnpm-usage** | All files | pnpm commands and troubleshooting | | **git-workflow** | All files | Commit conventions, branch strategy, PR guidelines | | **development-workflow** | All files | Code style, file naming, project conventions | +| **nix-workflow** | All files | Nix development environment and CI setup | | **typescript-patterns** | `**/*.ts` | Type safety, exhaustiveness checks, clean code | | **typescript-testing** | `**/*.test.ts` | Vitest, MSW mocking, fs-fixture | | **file-operations** | `**/*.ts` | Native fetch API patterns and error handling | From e1e519ec1ea0dae9b0bc3c7b26156ce62c9cca90 Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:04:56 +0000 Subject: [PATCH 3/4] chore(ci): remove unused similarity and nixfmt from lint job These tools are not used by pnpm lint (only oxfmt, oxlint, knip). --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4450c4c..27712c0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,7 +41,7 @@ jobs: - name: Setup Nix uses: ./.github/actions/setup-nix with: - tools: nodejs_24 pnpm_10 oxlint oxfmt similarity nixfmt + tools: nodejs_24 pnpm_10 oxlint oxfmt - name: Run Lint run: pnpm run lint From 004f471df35f851a6cf7ae6b63e66e235d650dcc Mon Sep 17 00:00:00 2001 From: ryoppippi <1560508+ryoppippi@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:05:14 +0000 Subject: [PATCH 4/4] chore(nix): update flake.lock --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index cd54cf2..58bdca6 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1768149890, - "narHash": "sha256-iihg1oHkVkYHD1pFQifGEP+Rw1g+LZQyDNbtAqpXtNM=", + "lastModified": 1768395095, + "narHash": "sha256-ZhuYJbwbZT32QA95tSkXd9zXHcdZj90EzHpEXBMabaw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4d113fe1f7bb454435a5cabae6cd283e64191bb7", + "rev": "13868c071cc73a5e9f610c47d7bb08e5da64fdd5", "type": "github" }, "original": {