Repository navigation
feat: add initial NUR repository setup - #1
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
🚧 Files skipped from review as they are similar to previous changes (11)
📝 WalkthroughWalkthroughThis change establishes a Nix repository for Mailtrap tooling. It packages ChangesRepository foundation
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ace337f to
a449fc7
Compare
| @@ -0,0 +1,58 @@ | |||
| # This file was generated by GoReleaser. DO NOT EDIT. | |||
There was a problem hiding this comment.
This file would be typically updated by PR from GoReleaser, but for now we're seeding the current version as is to have the package present.
Once the pipeline is fully in place we'll make a new release to do it properly.
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.github/workflows/build.yml (1)
33-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExercise the flake interface in CI.
The current checks only evaluate
default.nixandci.nix; they can pass whileflake.nixoutputs are broken. Add anix flake checkor targeted flake evaluation after fixing the system mismatch.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/build.yml around lines 33 - 43, Add a CI step after resolving the system mismatch that runs `nix flake check` (or an equivalent targeted evaluation) against the repository’s flake interface. Keep the existing `Check evaluation` and `Build nix packages` steps intact while ensuring flake outputs are exercised during workflow validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build.yml:
- Around line 22-30: Update the checkout step using actions/checkout@v5 to set
persist-credentials to false, and restrict the workflow’s permissions to
read-only where possible while preserving the existing build behavior.
In `@flake.nix`:
- Around line 7-17: Restrict the forAllSystems systems list used by
legacyPackages and packages to the four platforms declared in mailtrap-local’s
meta.platforms, rather than iterating over nixpkgs.lib.systems.flakeExposed.
Update the shared system-attribute generation near forAllSystems so unsupported
targets cannot evaluate urlMap.${system}; preserve the existing package
filtering and per-system imports for supported platforms.
In `@README.md`:
- Around line 21-40: Update the README flake example’s outputs attrset to expose
mailtrap-local as an actual package output, using the existing
pkgs.mailtrap-local package and the configured system attribute so copied flakes
can build or run it.
- Around line 52-57: Update the non-flake Nix example around the mailtrap
binding so the mailtrap assignment is valid top-level syntax, wrapping it in a
let...in expression or attribute set while preserving the existing pkgs
inheritance and mailtrap.mailtrap-local usage.
---
Nitpick comments:
In @.github/workflows/build.yml:
- Around line 33-43: Add a CI step after resolving the system mismatch that runs
`nix flake check` (or an equivalent targeted evaluation) against the
repository’s flake interface. Keep the existing `Check evaluation` and `Build
nix packages` steps intact while ensuring flake outputs are exercised during
workflow validation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 09b726da-1221-494b-99c4-fc323c2f7946
⛔ Files ignored due to path filters (1)
flake.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
.github/workflows/build.ymlLICENSEREADME.mdci.nixdefault.nixflake.nixlib/default.nixnixos-modules/default.nixoverlay.nixoverlays/default.nixpkgs/mailtrap-local/default.nix
6846445 to
c4aa03f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
flake.nix (1)
3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCommit
flake.lockfor the nixpkgs input.Line 3 uses an unlocked branch reference, and no lock file is included in the supplied changes. Generate and commit
flake.lockso CI and consumers resolve the same nixpkgs revision; Nix documents lock files as the mechanism for pinning unlocked flake inputs. (releases.nixos.org)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@flake.nix` at line 3, Generate a flake.lock for the nixpkgs input declared by inputs.nixpkgs.url, then include the generated lock file in the change so the branch reference resolves to a pinned revision..github/workflows/build.yml (1)
22-26: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winPin third-party actions to immutable commits.
actions/checkout@v5andcachix/install-nix-action@v31are mutable tag references. Pin them to full commit SHAs, retaining version comments, so CI behavior cannot change without a repository diff.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/build.yml around lines 22 - 26, Update the GitHub Actions steps using actions/checkout and cachix/install-nix-action to reference their full immutable commit SHAs instead of mutable version tags, while retaining comments identifying the corresponding versions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 51-60: Update the Nix example heading and surrounding guidance so
the shown derivation is presented only as shell.nix content, not as
~/.config/nixpkgs/config.nix; alternatively, provide a separate valid config.nix
wrapper or overlay example while preserving the existing mailtrap-local
derivation.
---
Nitpick comments:
In @.github/workflows/build.yml:
- Around line 22-26: Update the GitHub Actions steps using actions/checkout and
cachix/install-nix-action to reference their full immutable commit SHAs instead
of mutable version tags, while retaining comments identifying the corresponding
versions.
In `@flake.nix`:
- Line 3: Generate a flake.lock for the nixpkgs input declared by
inputs.nixpkgs.url, then include the generated lock file in the change so the
branch reference resolves to a pinned revision.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f2b40e8d-da22-4008-8691-5aa4a007e8a0
⛔ Files ignored due to path filters (1)
flake.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
.github/workflows/build.ymlLICENSEREADME.mdci.nixdefault.nixflake.nixlib/default.nixnixos-modules/default.nixoverlay.nixoverlays/default.nixpkgs/mailtrap-local/default.nix
🚧 Files skipped from review as they are similar to previous changes (1)
- overlay.nix
c4aa03f to
dd81f33
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build.yml (1)
45-46: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winExercise the packaged binary’s version contract.
The workflow builds
mailtrap-localbut never executes it, so it does not validate the PR’s required0.2.0runtime version. Add a post-build check using the CLI’s version command and assert that its output contains0.2.0.Proposed check
- name: Build nix packages run: nix shell -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs + - name: Check mailtrap-local version + run: nix run .#mailtrap-local -- --version | grep -F '0.2.0'🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/build.yml around lines 45 - 46, Update the “Build nix packages” workflow step to execute the packaged mailtrap-local binary after building it, invoke its CLI version command, and assert that the output contains “0.2.0”.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/build.yml:
- Around line 45-46: Update the “Build nix packages” workflow step to execute
the packaged mailtrap-local binary after building it, invoke its CLI version
command, and assert that the output contains “0.2.0”.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bdfa2853-c2f1-4128-8dca-52f1214052bc
⛔ Files ignored due to path filters (1)
flake.lockis excluded by!**/*.lock
📒 Files selected for processing (11)
.github/workflows/build.ymlLICENSEREADME.mdci.nixdefault.nixflake.nixlib/default.nixnixos-modules/default.nixoverlay.nixoverlays/default.nixpkgs/mailtrap-local/default.nix
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
Co-authored-by: Cursor <cursoragent@cursor.com>
dd81f33 to
8ae1445
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
What & why
Bootstrap a Mailtrap NUR-style Nix package repo so we can distribute
mailtrap-local(and later other tools) via Nix, with release updates driven from goreleaser.default.nix, flake, overlay, CI eval/build workflow.mailtrap-localas a prebuilt GitHub Releases package (same artifacts as Homebrew), owned by goreleaser PRs on each tag.How to test
Human QA on macOS, against this PR branch (not
main):github:mailtrap/mailtrap-nur/chore/initial-nur-setup#mailtrap-localInstall Nix (once per machine)
Recommended on macOS: Determinate Nix (flakes +
nixcommand enabled by default).GUI (preferred): download the universal pkg from https://install.determinate.systems/ and run it.
CLI:
Then open a new Terminal tab and check:
Alternative: official installer at https://nixos.org/download/ (macOS) — after install, ensure flakes are on (
experimental-features = nix-command flakesin~/.config/nix/nix.conf).0. Prep
nix --versionworks)aarch64-darwin, Intel =x86_64-darwinuname -m # arm64 → aarch64-darwin; x86_64 → x86_64-darwin3535/3550(or use alt ports below)mailtrap-localalready installed, stop it so ports do not conflict:1. Flake resolve + build
Optional (local checkout of this branch):
2. One-shot run (
nix run)3. Web UI (real embedded SPA)
With the process running:
4. SMTP catch
New terminal:
5.
mailtrap-sendmailsymlinkmailtrap-localandmailtrap-sendmailboth in$out/binmailtrap-local6. Profile install (persist on PATH)
nix profile install github:mailtrap/mailtrap-nur/chore/initial-nur-setup#mailtrap-local hash -r which mailtrap-local mailtrap-local --version which mailtrap-sendmailmailtrap-local --versionstill worksCleanup when done:
nix profile list # then: nix profile remove <index-or-name>7. Overlay path (flake consumer)
Minimal test flake in a tmp dir:
nix build .#default --print-out-paths ./result/bin/mailtrap-local --versionpkgs.mailtrap-local#mailtrap-local8. macOS-specific failure watch
…_darwin_arm64.tar.gz(not amd64 under Rosetta unless intentional)…_darwin_amd64.tar.gzpkgs/mailtrap-local/default.nix)type -a mailtrap-localPass bar
Build+run on this Mac arch, UI is real, SMTP + sendmail both land mail. Profile + overlay recommended once each.
Summary by CodeRabbit
mailtrap-localpackage (version 0.2.0) with support for Linux and macOS.