Your Nix package is already distributable! Users can run it directly from GitHub without any additional setup on your end.
nix run --extra-experimental-features 'nix-command flakes' github:RayLabsHQ/gitea-mirrorThat's it! No releases, no CI, no infrastructure needed. It works right now.
- Nix fetches your repo from GitHub
- Nix reads
flake.nixandflake.lock - Nix builds the package on their machine
- Nix runs the application
- Result cached in
/nix/storefor reuse
Users can already use it from GitHub. No CI or releases required.
GitHub Actions validates builds on every push with Magic Nix Cache (free, no setup).
Why: Users can pin to specific versions
How:
# When ready to release
git tag v3.8.11
git push origin v3.8.11
# Users can then pin to this version
nix run github:RayLabsHQ/gitea-mirror/v3.8.11No additional CI needed - tags work automatically with flakes!
Why: Maximum discoverability and trust
When: After package is stable and well-tested
How: Submit PR to https://github.com/NixOS/nixpkgs
flake.nix- Package definitionflake.lock- Dependency lock file.envrc- direnv integration
NIX.md- Quick reference for usersdocs/NIX_DEPLOYMENT.md- Complete deployment guidedocs/NIX_DISTRIBUTION.md- Distribution guide for you (maintainer)README.md- Updated with Nix instructions
.github/workflows/nix-build.yml- Builds and validates on Linux + macOS
.gitignore- Added Nix artifacts
| Setup | Time | User Experience | What You Need |
|---|---|---|---|
| Direct GitHub | 0 min | Slow (build from source) | Nothing! Works now |
| + Git Tags | 2 min | Versionable | Just push tags |
| + nixpkgs | Hours | Official/Trusted | PR review process |
Recommendation: Direct GitHub works now. Add git tags for versioning. Consider nixpkgs submission once stable.
You can test it right now:
# Test direct GitHub usage
nix run --extra-experimental-features 'nix-command flakes' github:RayLabsHQ/gitea-mirror
# Test with specific commit
nix run github:RayLabsHQ/gitea-mirror/$(git rev-parse HEAD)
# Validate flake
nix flake checkUsers will find instructions in:
- README.md - Installation section (already updated)
- NIX.md - Quick reference
- docs/NIX_DEPLOYMENT.md - Detailed guide
All docs include the correct commands with experimental features flags.
# 1. Update version in package.json
vim package.json
# 2. Update version in flake.nix (line 17)
vim flake.nix # version = "3.8.12";
# 3. Commit and tag
git add package.json flake.nix
git commit -m "chore: bump version to v3.8.12"
git tag v3.8.12
git push origin main
git push origin v3.8.12Users can then use: nix run github:RayLabsHQ/gitea-mirror/v3.8.12
- Bug fixes
- Small changes
- Continuous updates
Users can always use latest from main: nix run github:RayLabsHQ/gitea-mirror
Ready to distribute RIGHT NOW
- Just commit and push your
flake.nix - Users can run directly from GitHub
- CI validates builds automatically
Optional: Submit to nixpkgs
- Maximum discoverability
- Official Nix repository
- Do this once package is stable
See docs/NIX_DISTRIBUTION.md for complete details!