Files
Pim Snel ed4d965208 feat: add nix flake support (sorry for this duplicate) (#459)
* add nix flake support

* feat: add Nix flake maintenance automation

* Add Nix Flake CI Validation

* fix updatescript, update flake

* make update-script compatible with macos

---------

Co-authored-by: Tabish Bidiwale <30385142+TabishB@users.noreply.github.com>
2026-01-16 13:00:11 -08:00

1.7 KiB

1. Create Update Script

  • 1.1 Create scripts/update-flake.sh file
  • 1.2 Add shebang and error handling (set -euo pipefail)
  • 1.3 Add path resolution for project root and files
  • 1.4 Make script executable (chmod +x)

2. Implement Version Update Logic

  • 2.1 Extract version from package.json using Node.js
  • 2.2 Use sed to update version in flake.nix
  • 2.3 Report if version already up-to-date
  • 2.4 Display detected version to user

3. Implement Hash Update Logic

  • 3.1 Set placeholder hash in flake.nix
  • 3.2 Run nix build and capture output (allow failure)
  • 3.3 Extract correct hash from build error using grep
  • 3.4 Handle case where hash extraction fails
  • 3.5 Update flake.nix with correct hash
  • 3.6 Display detected hash to user

4. Add Build Verification

  • 4.1 Run nix build after hash update
  • 4.2 Check for dirty git tree warning
  • 4.3 Report success or failure clearly

5. Add User Feedback

  • 5.1 Add progress messages for each step
  • 5.2 Add success summary with version and hash
  • 5.3 Add next steps instructions (test, commit)
  • 5.4 Add error messages with context

6. Create Documentation

  • 6.1 Create scripts/README.md
  • 6.2 Document update-flake.sh purpose and usage
  • 6.3 Add example workflow
  • 6.4 Document other existing scripts

7. Testing

  • 7.1 Test script runs successfully
  • 7.2 Verify version is extracted correctly
  • 7.3 Verify hash is updated correctly
  • 7.4 Verify build succeeds after update
  • 7.5 Test idempotency (running twice works)

8. Integration

  • 8.1 Add note to release process documentation
  • 8.2 Use in next actual version bump to validate workflow