Repository navigation
fix(nix): defer programs.worktrunk to home-manager's own module - #4788
Merged
Merged
Conversation
home-manager master declares programs.worktrunk itself, so importing this flake's homeModules.default under it fails with "The option `programs.worktrunk.enable' ... is already declared". Our module declared a subset of the same options (enable, package, and the four shell integrations, with the same shell init), and home-manager's adds settings and claudeCodeIntegration. The one thing ours added was a package default pointing at this flake's build. homeModules.default now sets programs.worktrunk.package to this flake's worktrunk with mkDefault, so a user's own setting still wins. It imports nix/home-manager-module.nix only when home-manager's modulesPath lacks programs/worktrunk.nix, which is every release before 26.11. Imports keep working on both sides: home-manager master and 26.11 onward use their own module, and 26.05 and older keep ours, with the same package and shell integration as before. A comment on the import says when to delete it. When home-manager ships the module but doesn't load it (disabledModules, or minimal mode), the import fails with a message saying how to load it. A home-module flake check evaluates both paths against stand-ins for home-manager, since `nix flake check` doesn't run homeModules through the module system.
home-manager's programs.worktrunk.claudeCodeIntegration links the worktrunk and wt-switch-create skills from the package's share/skills/worktrunk/, where nixpkgs' installAgentSkills hook puts them; wt-switch-create is on whenever claudeCodeIntegration is. This flake's package installed no skills, so with it as programs.worktrunk.package, which homeModules.default sets, enabling claudeCodeIntegration failed the build with "Claude Code skill source ... is neither a file nor a directory". The package now copies the repo-root skills/ into that layout, and the source filter keeps skills/ directories. The locked nixpkgs predates installAgentSkills, so a postInstall does the copy.
worktrunk-bot
approved these changes
Nov 14, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
home-manager master now declares
programs.worktrunkitself (merged in September, shipping from release 26.11), so importing this flake'shomeModules.defaultalongside it fails with "The optionprograms.worktrunk.enable' … is already declared".homeModules.defaultnow defers to home-manager's module and only defaults itspackageto this flake's build; on releases without that module (26.05 and older) it importsnix/home-manager-module.nixas before, so nobody's evaluation breaks. The flake package also installs the agent skills undershare/skills/worktrunk/, where home-manager'sclaudeCodeIntegration` links them from and fails the build without them.Worth weighing: the legacy import and module are temporary, with a comment to delete them once home-manager 26.05 is end-of-life, about the end of December. A new
home-moduleflake check evaluates the module under stubs of both home-manager layouts, sincenix flake checknever ranhomeModulesthrough the module system.viicslen hit the clash in viicslen-nix/nixos. Requested by max-sixty. Reproduced on
mainand checked in anixos/nixcontainer against real home-manager master and release-26.05: both evaluate with the flake's build as the default, and a user's ownpackagewins.nix flake check --no-build --all-systemspasses, and each new assertion fails against a broken module; the full flake build runs in the nightly job this PR triggers.