Skip to content

fix(nix): fix dolt launchd ProgramArguments type error - #1492

Merged
shunkakinoki merged 2 commits into
mainfrom
bridge-cse_01EDgELPMMxETUCGMvtqrQLv
Apr 18, 2026
Merged

fix(nix): fix dolt launchd ProgramArguments type error#1492
shunkakinoki merged 2 commits into
mainfrom
bridge-cse_01EDgELPMMxETUCGMvtqrQLv

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • writeShellScript returns a derivation that nix-darwin's ProgramArguments type checker rejects as non-string
  • Replace with pkgs.replaceVars + bash invocation pattern used by all other launchd agents in this repo
  • Fixes nix-darwin build failure: A definition for option 'home-manager.users.shunkakinoki.launchd.agents.dolt.config.ProgramArguments."[definition 1-entry 1]"' is not of type 'string'

Test plan

  • Nix CI (nix-darwin job) passes
  • Shell inline check passes (no writeShellScript with inline content)

Summary by cubic

Fixes a nix-darwin build failure for the dolt launchd agent by switching to a bash + pkgs.replaceVars script so ProgramArguments are valid strings and the service starts reliably on macOS. Also formats drifted files with treefmt (nixfmt, shfmt).

  • Bug Fixes
    • Use a pkgs.replaceVars script invoked via ${pkgs.bash}/bin/bash in ProgramArguments.
    • Update Service.ExecStart to use the same bash invocation.

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

writeShellScript returns a derivation that nix-darwin's ProgramArguments
type checker rejects. Use the same bash+script pattern as all other
launchd agents in this repo.
@mesa-dot-dev

mesa-dot-dev Bot commented Apr 17, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai

coderabbitai Bot commented Apr 17, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This change refactors the dolt service configuration in Home Manager by switching from a wrapped script approach to directly using pkgs.replaceVars on an external shell script file. The launchd and systemd service invocations are updated to explicitly call bash with the script path.

Changes

Cohort / File(s) Summary
Dolt Service Script Refactoring
home-manager/services/dolt/default.nix
Replaced writeShellScript wrapper with direct pkgs.replaceVars ./start.sh invocation; updated launchd ProgramArguments to invoke bash explicitly with script path; updated systemd ExecStart to run bash ${startScript} instead of executing script directly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 A script once wrapped in Nix's gentle hands,
Now freed to roam in .sh across the lands,
With bash invoked by name, both loud and clear,
The dolt service hops on without a fear! 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing a nix-darwin type error with dolt launchd ProgramArguments by refactoring the script construction approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly describes the changeset: replacing writeShellScript with pkgs.replaceVars to fix a nix-darwin type error for ProgramArguments.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bridge-cse_01EDgELPMMxETUCGMvtqrQLv

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 and usage tips.

@mesa-dot-dev

mesa-dot-dev Bot commented Apr 17, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Fixes a nix-darwin build failure for the dolt launchd agent by switching to a bash + pkgs.replaceVars script, ensuring ProgramArguments are valid strings and the service starts reliably on macOS.

What changed?

  • home-manager/services/dolt/default.nix: The method for generating the Dolt service's startScript has been simplified by directly using pkgs.replaceVars. Consequently, both launchd and systemd service configurations were updated to explicitly execute this script using bash for consistent behavior.

Description generated by Mesa. Update settings

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 1 file

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request refactors the startScript definition in the Dolt home-manager service to use pkgs.replaceVars directly and updates the service configurations to explicitly invoke bash for both Darwin and Linux environments. A review comment suggests quoting the script path in the systemd ExecStart command to improve robustness and follow shell best practices.

Service = {
Type = "simple";
ExecStart = startScript;
ExecStart = "${pkgs.bash}/bin/bash ${startScript}";

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.

medium

While Nix store paths do not contain spaces, it is generally safer and more robust to quote the script path in ExecStart to prevent potential issues if the path were ever to change or if this pattern is copied elsewhere.

      ExecStart = "${pkgs.bash}/bin/bash '${startScript}'";

- config/hyprpanel/default.nix (nixfmt)
- home-manager/modules/local-scripts/decafinate.sh (shfmt)
@shunkakinoki
shunkakinoki merged commit c61f436 into main Apr 18, 2026
35 of 38 checks passed
@shunkakinoki
shunkakinoki deleted the bridge-cse_01EDgELPMMxETUCGMvtqrQLv branch April 18, 2026 08:40
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