Skip to content

feat(nix): install shell completions - #3

Merged
nklmilojevic merged 1 commit into
mainfrom
feat/shell-completions
Oct 22, 2026
Merged

nklmilojevic merged 1 commit into
mainfrom
feat/shell-completions

Conversation

@nklmilojevic

Copy link
Copy Markdown
Contributor

The flake package shipped only bin/mailerlite, so shells never got its completions, even though mailerlite completion <shell> exists.

  • postInstall runs mailerlite completion bash|fish|zsh and installs the output with installShellCompletion. installPhase now calls runHook preInstall/postInstall so the hook runs.
  • It is darwin only. The Linux release assets are *-unknown-linux-gnu binaries that this flake doesn't patch for Nix, so they can't run in the build sandbox. Linux packages are unchanged. Patching them (e.g. autoPatchelfHook) would be a separate change.
  • update-flake.yml only rewrites the version and sha256- hash lines, so releases are unaffected.

Checked: nix build on aarch64-darwin produces bash, fish and zsh completions, and the fish script passes fish -n. The x86_64-linux derivation still evaluates.

@nklmilojevic
nklmilojevic merged commit 7061b5d into main Oct 22, 2026
9 of 10 checks passed
@mailerlite-kritika

Copy link
Copy Markdown

Re-runKritika Review

Installs bash, fish and zsh completions in the Nix flake on darwin

No findings

Confidence 5/5 · low risk: The change only affects the Nix build on darwin: it adds completion generation from the installed binary and leaves Linux packages unchanged. The process-substitution form matches the documented installShellFiles usage, and the author reports a successful aarch64-darwin build with bash, fish and zsh output. Risk rests on the build-only scope, since nothing runs at deploy time.

Summary

The flake's installPhase now calls runHook preInstall and runHook postInstall. On darwin, postInstall generates completions from the installed binary with installShellCompletion. Linux packages are unchanged, because those release binaries aren't patched for Nix and can't run in the build sandbox. The process-substitution form is the documented installShellFiles usage, and the darwin guard is explained in a comment. I found nothing to flag.

What's good

  • The darwin-only guard has a comment explaining why Linux is excluded, so Linux builds stay unchanged.
  • Adding the runHook preInstall and runHook postInstall calls makes the new hook actually run, and keeps any other hooks working.
Review context · 0/6 commands
  • Commands run: none

Reviews (1) · Last reviewed commit: "feat(nix): install shell completions" · claude-sonnet-5-5

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