Skip to content

flake: let module callers supply pkgs so overlays reach the build#2244

Merged
LuckShiba merged 2 commits intoAvengeMedia:masterfrom
amaanq:overlay-passthrough
Apr 27, 2026
Merged

flake: let module callers supply pkgs so overlays reach the build#2244
LuckShiba merged 2 commits intoAvengeMedia:masterfrom
amaanq:overlay-passthrough

Conversation

@amaanq
Copy link
Copy Markdown
Contributor

@amaanq amaanq commented Apr 19, 2026

The nixosModule/homeModule path previously called buildDmsPkgs pkgs but internally referenced self.packages.${system}.default, which was instantiated via nixpkgs.legacyPackages, an unoverlayed pkgs. That meant downstream flakes couldn't reach through their own overlays to the dms-shell build (e.g. to swap kdePackages.sonnet or trim perl out of the aspell closure).

Extract the derivation as mkDmsShell = pkgs: ... at the top-level let, and call it from both packages.${system}.dms-shell (for direct consumers of the flake) and buildDmsPkgs pkgs (for module consumers, which now pass in the system's overlayed pkgs).

Also re-checks overrideAttrs / .override still work: mkDmsShell pkgs is the same pkgs.lib.makeOverridable wrapper as before, just parameterized on the caller's pkgs instance.

Thanks!

@bbedward bbedward requested a review from LuckShiba April 20, 2026 13:15
Copy link
Copy Markdown
Collaborator

@LuckShiba LuckShiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes make sense! I just think the comment you added is a bit way too verbose. What do you think about this?

Comment thread flake.nix Outdated
The nixosModule/homeModule path previously called `buildDmsPkgs pkgs` but
internally referenced `self.packages.${system}.default`, which was
instantiated via `nixpkgs.legacyPackages`, an unoverlayed pkgs. That
meant downstream flakes couldn't reach through their own overlays to
the dms-shell build (e.g. to swap `kdePackages.sonnet` or trim perl
out of the aspell closure).

Extract the derivation as `mkDmsShell = pkgs: ...` at the top-level
`let`, and call it from both `packages.${system}.dms-shell` (for
direct consumers of the flake) and `buildDmsPkgs pkgs` (for module
consumers, which now pass in the system's overlayed pkgs).

Also re-checks overrideAttrs / .override still work: `mkDmsShell pkgs`
is the same `pkgs.lib.makeOverridable` wrapper as before, just
parameterized on the caller's pkgs instance.
@amaanq amaanq force-pushed the overlay-passthrough branch from bfbff73 to 452968b Compare April 27, 2026 04:18
@amaanq amaanq requested a review from LuckShiba April 27, 2026 04:19
@LuckShiba LuckShiba closed this Apr 27, 2026
@LuckShiba LuckShiba reopened this Apr 27, 2026
@LuckShiba
Copy link
Copy Markdown
Collaborator

oops, accidentally closed 😅

@LuckShiba LuckShiba merged commit dc5636b into AvengeMedia:master Apr 27, 2026
2 checks passed
@LuckShiba
Copy link
Copy Markdown
Collaborator

Thanks!

@amaanq amaanq deleted the overlay-passthrough branch April 27, 2026 19:44
Purian23 pushed a commit that referenced this pull request Apr 29, 2026
)

The nixosModule/homeModule path previously called `buildDmsPkgs pkgs` but
internally referenced `self.packages.${system}.default`, which was
instantiated via `nixpkgs.legacyPackages`, an unoverlayed pkgs. That
meant downstream flakes couldn't reach through their own overlays to
the dms-shell build (e.g. to swap `kdePackages.sonnet` or trim perl
out of the aspell closure).

Extract the derivation as `mkDmsShell = pkgs: ...` at the top-level
`let`, and call it from both `packages.${system}.dms-shell` (for
direct consumers of the flake) and `buildDmsPkgs pkgs` (for module
consumers, which now pass in the system's overlayed pkgs).

Also re-checks overrideAttrs / .override still work: `mkDmsShell pkgs`
is the same `pkgs.lib.makeOverridable` wrapper as before, just
parameterized on the caller's pkgs instance.

Co-authored-by: Lucas <43530291+LuckShiba@users.noreply.github.com>
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.

2 participants