-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
nixos/wayland: add gtk portal to all applicable compositors #342646
Conversation
If
nixpkgs/nixos/modules/config/xdg/portals/wlr.nix Lines 53 to 56 in 1925c60
|
@JohnRTitor I agree, it would be best to add xdpg for all standalone compositors, which are less likely to come with a complete portal implementation. |
It won't conflict because list types merge. They will just merge with one another. |
I don't mind going about implementing this, it definitely makes a lot more sense imo. |
1331a3c
to
53f5b78
Compare
I've rebased and included the new push. Let me know if this is acceptable and if it is I will remove the sway commit. I've only left it at the moment in case changing my PR isn't desirable. All modules tested as below: let
# file exists in root of nixpkgs repo
self = builtins.getFlake (toString ./.);
config = {
programs = {
# each one tested one at a time, this is here for completion sake
sway.enable = true;
wayfire.enable = true;
wayland.miracle-wm.enable = true;
cardboard.enable = true;
river.enable = true;
hyprland.enable = true;
labwc.enable = true;
};
};
in (self.lib.nixosSystem {
modules = [
({
nixpkgs.hostPlatform = "x86_64-linux";
nixpkgs.config.allowUnfree = true;
nixpkgs.config.allowBroken = true; # needed for cardboard package
fileSystems."/".device = "nodev";
boot.loader.grub.devices = [ "nodev" ];
})
];
}).config.xdg.portal.extraPortals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, you can remove the sway-specific commit.
53f5b78
to
9020d82
Compare
Done, ready for review and merge. |
having both gnome + hyprland enabled causes outputs.nixosConfigurations.moot-pc.config.xdg.portal.extraPortals
[
«derivation /nix/store/v04z3wqji8na8vdb749glh944jwcw1s7-xdg-desktop-portal-gnome-46.2.drv»
«derivation /nix/store/jiv5f9bcv5qgchr8k3ykppwvlb9r10ix-xdg-desktop-portal-gtk-1.15.1.drv»
«derivation /nix/store/x5pbssd6a9dxn2yj3m8vf3nhgyfjn9z3-gnome-keyring-46.2.drv»
«derivation /nix/store/4kcmjgvs32lshmr57fgmrjkwy8yx1hin-xdg-desktop-portal-hyprland-1.3.6+date=2024-09-28_7e500e6.drv»
«derivation /nix/store/q3diw8lfynliqwh3ji68fkh05vkdf40r-xdg-desktop-portal-gtk-1.15.1.drv»
] and thereby breaking current builds
perhaps it should make sure that it won't add existing portals |
Tracked in #345733, the root cause here is GNOME uses a different build of gtk portal, causing it to conflict. |
Description of changes
Most standalone wayland compositors lack a sufficient xdg-desktop-portal implementation. More often than not, their portal contains only screen capture protocols but completely lacks file picker functionality (see: archwiki/xdg_desktop_portal).
Most of the nixos modules used
lib.mkDefault [ "wlr" "gtk" ];
as the solution to this, but never actually provided the gtk portal. This PR adds the gtk portal as an entry in the commonwayland-session.nix
file, enabling support for all compatible compositors.PS: if this constitutes a release change let me know !
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.