Add nix flake with devshell, formatting, build and checks#773
Merged
hazre merged 1 commit intoSableClient:devfrom May 8, 2026
Merged
Add nix flake with devshell, formatting, build and checks#773hazre merged 1 commit intoSableClient:devfrom
hazre merged 1 commit intoSableClient:devfrom
Conversation
a382df0 to
7485a0d
Compare
Contributor
Author
|
After reading through edit( |
this nix flake is heavily based off of prior work i have done in one of my repos. it comes with the following features: - building sable: `nix build .#sable` or just `nix build`. creates a `result/` dir with the built application. - devshell: nix users now no longer need to do download and install all the dependencies for sable by themselves. the devshell comes with all the dependencies needed to develop sable - checks: `nix flake check` is configured to perform all checks listed in `CONTRIBUTING.md` (fmt:check, lint, typecheck, knip, test:run) - formatting: `nix fmt` runs all the formatters pnpm would also call, but provides a more familiar interface for nix users. - pre-commit checks: nix users can benefit from having their changes checked for before the commit goes through. yay :3 `.vscode/settings.json` was updated to include hints for VS Code users using the "nix env selector" extension to auto-detect the nix dev environment, if you have nix installed. I had to change `oxfmt.config.ts` just a tiny bit to make it work with the nix stuff, because `node_modules` does not exist inside the nix build sandbox. `pnpm fmt` successfully runs, so nothing should have broken. `flake-lock-fix.yml` is a small workflow heavily based on <https://docs.determinate.systems/guides/fix-hashes/>, which triggers on pushes to `dev` which change `pnpm-lock.yaml`. The workflow uses `determinate-nixd` to fix hashes in the `flake.nix`, then pushes the changes to `dev` automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
this nix flake is heavily based off of prior work i have done in one of my repos. it comes with the following features:
nix build .#sableor justnix build. creates aresult/dir with the built application.nix flake checkis configured tolintandtest:runthe application, in addition to checking for correct formattingnix fmtruns all the formatters pnpm would also call, but provides a more familiar interface for nix users..vscode/settings.jsonwas updated to include hints for VS Code users using the "nix env selector" extension to auto-detect the nix dev environment, if you have nix installed.I had to change
oxfmt.config.tsjust a tiny bit to make it work with the nix stuff, becausenode_modulesdoes not exist inside the nix build sandbox.pnpm fmtsuccessfully runs, so nothing should have broken.flake-lock-fix.ymlis a small workflow heavily based on https://docs.determinate.systems/guides/fix-hashes/, which triggers on pushes todevwhich changepnpm-lock.yaml. The workflow usesdeterminate-nixdto fix hashes in theflake.nix, then pushes the changes todevautomatically.Fixes #
Type of change
Checklist:
AI disclosure: