Skip to content

fix(tokscale): expose crontab during activation - #2213

Closed
shunkakinoki wants to merge 1 commit into
mainfrom
codex/tokscale-activation-path
Closed

fix(tokscale): expose crontab during activation#2213
shunkakinoki wants to merge 1 commit into
mainfrom
codex/tokscale-activation-path

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • give the Tokscale Home Manager activation hook an explicit NixOS-safe PATH
  • include the system wrapper/profile paths where crontab is exposed
  • keep the cron installer and generated schedule unchanged

Validation

Closes shunkakinokisoftware-bb87


Summary by cubic

Set an explicit NixOS-safe PATH during Home Manager activation so crontab is found and cron setup doesn’t fail. Keeps the existing installer and schedule; resolves shunkakinokisoftware-bb87.

  • Bug Fixes
    • Add activationPath including /run/wrappers/bin, /run/current-system/sw/bin, lib.makeBinPath for coreutils and gawk, plus /usr/bin and /bin.
    • Run activate-cron.sh via env PATH=$activationPath before bash, leaving cronCommand unchanged.

Written for commit aa1fa3d. Summary will update on new commits.

Review in cubic

@indent-zero

indent-zero Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
PR Summary

Ensures the Linux home-manager activation for the tokscale service can locate crontab and awk when running activate-cron.sh. Previously the activation inherited whatever PATH home-manager provided, which on some hosts lacked these binaries and caused activation to fail. The fix scopes an explicit PATH to the script invocation without leaking into the surrounding activation shell.

  • Added a new activationPath let-binding that layers /run/wrappers/bin, /run/current-system/sw/bin, Nix-store paths for pkgs.coreutils + pkgs.gawk, and /usr/bin:/bin fallbacks.
  • Changed the home.activation.installTokscaleCron snippet to invoke the script via ${pkgs.coreutils}/bin/env PATH=<activationPath> bash …, keeping the runtime binPath used by the installed cron entry unchanged.

Issues

1 potential issue found:

  • crontab is not sourced from a Nix package in activationPath — activation relies on the host providing it via /run/wrappers/bin (NixOS with services.cron.enable = true) or /usr/bin; on a NixOS host without cron enabled, activation will still fail with the existing command -v crontab error. Not a regression, but worth adding pkgs.cronie/pkgs.cron (or documenting the host requirement) if you want activation to be self-contained. → Autofix

CI Checks

Waiting for CI checks...


⚡ Autofix All Issues

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@shunkakinoki, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 18 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 85cc693a-724e-4a5c-a849-929f3a3f84da

📥 Commits

Reviewing files that changed from the base of the PR and between e3cd7d9 and aa1fa3d.

📒 Files selected for processing (1)
  • home-manager/services/tokscale/default.nix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shunkakinoki

Copy link
Copy Markdown
Owner Author

Closing as a duplicate of #2212, which contains the same activation fix and is already merged.

@shunkakinoki
shunkakinoki deleted the codex/tokscale-activation-path branch August 3, 2026 03:16
])
"/usr/bin"
"/bin"
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latent: crontab isn't Nix-provided in activationPath. The new PATH exposes /run/wrappers/bin, /run/current-system/sw/bin, pkgs.coreutils, pkgs.gawk, /usr/bin, and /bin — but no Nix package here provides crontab. This works today because the host provides it (NixOS setuid wrapper when services.cron.enable = true, or /usr/bin/crontab on non-NixOS Linux). If a user runs home-manager switch on a NixOS host without cron enabled, activation still fails with the existing command -v crontab error from activate-cron.sh:9-12 (no regression). Consider either (a) adding pkgs.cronie (or similar) to activationPath via lib.makeBinPath so activation is self-contained, or (b) documenting the host cron requirement in the module. Either way, the current PR is safe — this is purely a note about the reachability boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant