hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
273 stars 47 forks source link

Nix: corrections for overlays, overrideable systems #75

Closed spikespaz closed 1 year ago

spikespaz commented 1 year ago
  1. The nix fmt command did not work for me so I have reverted it to use legacyPackages for simplicity. It works now.
  2. Before there was one default overlay, which would make it hard to get individual packages out from the overlay. Would need an extra wrapper function. Now each package has its own overlay, while default combines them all. Brought in mkJoinedOverlays from the Hyprland flake.
    • $ nix eval 'path:.#overlays' --apply 'builtins.attrNames'
      [ "default" "hyprland-share-picker" "xdg-desktop-portal-hyprland" ]
  3. Moved version into nix/overlays.nix.
    • Perhaps we should adopt my (unpublished) changes from Alexays/Waybar and pull the first version fragment from meson.build.
  4. Added another input nix-systems so that the systems is overrideable. I like this much better than using flake-utils or flake-parts.
  5. The attributes of the packages output are inherited from internal pkgsFor, which contains all of the overlays pre-applied.
    • $ nix eval 'path:.#packages.x86_64-linux' --apply 'builtins.attrNames'
      [ "default" "hyprland-share-picker" "xdg-desktop-portal-hyprland" ]
spikespaz commented 1 year ago

@fufexan I am conflicted about the naming of the xdph overlay. I like that it is shorter as xdph, and it is unique enough that there should be low chance of conflict. On the other hand, it is inconsistent with the name of the package. What is your opinion? Should the xdph overlay be renamed to match the xdg-desktop-portal-hyprland package name?

fufexan commented 1 year ago

Sure, let's use the full name.

spikespaz commented 1 year ago

Sure, let's use the full name.

Should share-picker also be hyprland-share-picker or xdph-share-picker?

spikespaz commented 1 year ago

I have renamed both names for both packages and overlays:

$ nix eval 'path:.#overlays' --apply 'builtins.attrNames'
[ "default" "hyprland-share-picker" "xdg-desktop-portal-hyprland" ]

$ nix eval 'path:.#packages.x86_64-linux' --apply 'builtins.attrNames'
[ "default" "hyprland-share-picker" "xdg-desktop-portal-hyprland" ]
fufexan commented 1 year ago

Do we need to separate xdph and the picker in different overlays though?

spikespaz commented 1 year ago

Do we need to separate xdph and the picker in different overlays though?

It would be nice to do, just in case someone (me) wants to specify their own overlay for one or the other. I was doing this because for hyprland-flake specifically, which has a default overlay, I was having a hard time determining what overlays to join as default. If they have separate names this becomes much easier rather than relying on upstream repositories to always keep the same outputs.

IMO it doesn't matter much, but is nice to have when needed. Saves me some code, and thinking.

spikespaz commented 1 year ago

Once this is merged I will update the other three flakes accordingly. End-users will have to use the new name hyprland-share-picker from the packages output instead of share-picker.