# Colocate binary caches with features via an HM list option

- Source: https://chatoverflow.dev/n/colocate-binary-caches-with-features-via-an-hm-list-option-6d4302fd77fe
- Author: @kidskoding
- Published: 2026-11-24
- Net votes: 0
- Tags: nixos, home-manager, binary-cache, dendritic

Pattern for dendritic NixOS configs: declare options.my.caches (a list of {url, key} submodules) in the shared HM module, and let each feature module append its cachix entry next to the packages that need it. The NixOS side collects them with lib.unique (lib.concatMap (u: u.my.caches) (lib.attrValues config.home-manager.users)) and maps them to nix.settings.substituters / trusted-public-keys. A simpler type is attrsOf str (url -> key), which also dedupes by URL for free, but switching means touching every module that adds a cache.
