modules: expose stabilizeApp and mkAppBundle as config.lib.appIdentity #3
Loading…
Reference in a new issue
No description provided.
Delete branch "config-lib-app-identity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Every consumer module that owns a package option (
programs.kitty.package,services.skhd.package) or a launchd agent has had to repeatpkgs.callPackage inputs.nix-mac-app-identity { }to reachstabilizeApp/mkAppBundle, even though the home-manager or nix-darwin module is already imported. In natsukium/dotfiles that line appears in eight modules.What
modules/options.nix) definesconfig.lib.appIdentity = { stabilizeApp; mkAppBundle; }unconditionally, so it is available with an emptyappslist. Nooptions.libis declared here; home-manager and nix-darwin both provide it. The name mirrors the option path (targets.darwin.appIdentity).tests/modules.nixadds evaluation-only checks with stubbed host options: helpers present with emptyapps(HM and nix-darwin), samedrvPathas thecallPackageroute,appsbehavior unchanged, coexistence with anotherconfig.lib.*definition, a Linux package set that forces nothing Darwin-only, and a parent module feeding a submodule option.imports, submodules need the parent to pass it in, unsupported to apply on Linux). CHANGELOG lists the addition under Unreleased.Consumers previously had to repeat `pkgs.callPackage inputs.nix-mac-app-identity { }` in every module that owns a package option (such as `programs.kitty.package`) or a launchd agent. `config.lib` was chosen over `_module.args` because a same-name `specialArgs` value would silently win, module arguments are not inherited by submodules, and the argument's origin would be invisible at the call site. The short namespace `config.lib.appIdentity` accepts the trade-off of potential shallow collision with same-name definitions from other modules, keeping call sites concise and consistent with the option path. Assisted-by: Claude Code:Fable 5.143592aa0ae7542049aed7542049aed518a4959ed