Skip to content

gnome: use overlay.nix #1346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

awwpotato
Copy link
Contributor

@awwpotato awwpotato commented May 22, 2025

fixes #1324

Things done

Notify maintainers

@danth

@stylix-automation stylix-automation bot added the topic: overlay Overlay changes label May 22, 2025
@awwpotato awwpotato force-pushed the gnome-overlay branch 3 times, most recently from 27e2f9d to c0fa59e Compare May 22, 2025 00:24
@stylix-automation stylix-automation bot added the topic: nixos NixOS target label May 22, 2025
@awwpotato awwpotato force-pushed the gnome-overlay branch 2 times, most recently from 3dc1ccb to 4bc2fbd Compare May 22, 2025 00:37
@awwpotato awwpotato added the backport: release-25.05 Changes to release-25.05 stable branch label May 22, 2025
@awwpotato awwpotato force-pushed the gnome-overlay branch 2 times, most recently from 43f46e4 to 3776e47 Compare May 30, 2025 02:27
@awwpotato
Copy link
Contributor Author

awwpotato commented May 30, 2025

oh no, having enable condition depend on pkgs is making the overlay inf recurse :( (or atleast I'm pretty sure that's whats happening) @MattSturgeon do you have any advice here?

@MattSturgeon
Copy link
Member

having enable condition depend on pkgs is making the overlay inf recurse

I don't see where an enable condition depends on pkgs?

lib.mkIf
(
config.stylix.enable
&& options.stylix.targets ? gnome
Copy link
Member

Choose a reason for hiding this comment

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

Q: is the gnome target module sometimes missing?

Maybe this would benefit from an explanatory comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gnome doesn't exist on darwin and droid

@awwpotato
Copy link
Contributor Author

having enable condition depend on pkgs is making the overlay inf recurse

I don't see where an enable condition depends on pkgs?

in /modules/gnome/hm.nix

@danth
Copy link
Collaborator

danth commented Jun 2, 2025

Note that the overlay is only necessary on NixOS: GNOME Shell is not installed by Home Manager, so there is never a need for the overlay to be enabled there. Maybe that makes it easier to avoid the infinite recursion.

@MattSturgeon
Copy link
Member

having enable condition depend on pkgs is making the overlay inf recurse

I don't see where an enable condition depends on pkgs?

in /modules/gnome/hm.nix

Ah, so the issue is the enable option defaults to config.stylix.autoEnable && pkgs.stdenv.hostPlatform.isLinux, but the same enable option is deciding whether or not pkgs is extended with the overlay.

I'm not convinced that should be inf-rec, because both instances of pkgs (extended or not) will have the same stdenv. Does the inf-rec go away if you explicitly define the enable option or temporarily remove the isLinux autoEnable? That'd rule out whether that is the actual issue.

Also, in hindsight, I'm not convinced my earlier feedback was needed. In theory, the final passed to the overlay function should be the same thing as the pkgs instance available via module args...

I'd like to rule out the enable option using an (unrelated) part of pkgs from being an actual problem before looking into alternative designs.

@awwpotato
Copy link
Contributor Author

Note that the overlay is only necessary on NixOS: GNOME Shell is not installed by Home Manager, so there is never a need for the overlay to be enabled there. Maybe that makes it easier to avoid the infinite recursion.

hmm I don't know how we would tell if the overlay is being used as part of NixOS or home-manager.

having enable condition depend on pkgs is making the overlay inf recurse

I don't see where an enable condition depends on pkgs?

in /modules/gnome/hm.nix

Ah, so the issue is the enable option defaults to config.stylix.autoEnable && pkgs.stdenv.hostPlatform.isLinux, but the same enable option is deciding whether or not pkgs is extended with the overlay.

I'm not convinced that should be inf-rec, because both instances of pkgs (extended or not) will have the same stdenv. Does the inf-rec go away if you explicitly define the enable option or temporarily remove the isLinux autoEnable? That'd rule out whether that is the actual issue.

replacing pkgs.stdenv.hostPlatform.isLinux with true seems to get rid of the issue.

Also, in hindsight, I'm not convinced my earlier feedback was needed. In theory, the final passed to the overlay function should be the same thing as the pkgs instance available via module args...

with the hm enable con set to true it seems like there isn't inf-rec from using the pkgs in the module args.

@MattSturgeon
Copy link
Member

Thanks for investigating!

That's frustrating, as I'm sure you'll run into this again with other overlays being conditional on a pkgs attr.

While you can work-around the issue by only importing the overlay portion of the module on NixOS, you may not have that luxury in other cases.

@awwpotato awwpotato closed this Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport: release-25.05 Changes to release-25.05 stable branch topic: nixos NixOS target topic: overlay Overlay changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gnome: should be using separate overlay.nix
3 participants