Fix hyprland_v3

This commit is contained in:
ediblerope 2026-05-13 23:00:43 +01:00
parent a0990bceee
commit db7bc35943

View file

@ -14,25 +14,31 @@ let
(builtins.readFile
"${pkgs.closureInfo { rootPaths = [ hyprland-pkgs.hyprland ]; }}/store-paths"))));
hyprland-wrapped = (pkgs.symlinkJoin {
hyprland-wrapped = pkgs.symlinkJoin {
name = hyprland-pkgs.hyprland.name;
paths = [ hyprland-pkgs.hyprland ];
nativeBuildInputs = [ pkgs.makeWrapper ];
# passthru inside symlinkJoin flows through runCommand → mkDerivation,
# which correctly sets drv.passthru. The display manager requires
# providedSessions; HM's hyprland module requires override.
passthru = {
providedSessions = [ "hyprland" ];
override = _: hyprland-wrapped;
};
postBuild = ''
wrapProgram $out/bin/start-hyprland \
--set LD_PRELOAD "${gcc15-lib}/lib/libstdc++.so.6"
wrapProgram $out/bin/Hyprland \
--set LD_PRELOAD "${gcc15-lib}/lib/libstdc++.so.6"
# The session .desktop symlinks to the original package and contains
# its absolute store path. Rewrite Exec= to our wrapped binary so
# GDM actually launches the LD_PRELOAD wrapper, not the bare binary.
desktop=$out/share/wayland-sessions/hyprland.desktop
orig=$(readlink -f "$desktop")
rm "$desktop"
sed "s|^Exec=.*|Exec=$out/bin/start-hyprland|" "$orig" > "$desktop"
'';
# symlinkJoin lacks passthru; restore it from the original so the display
# manager finds providedSessions, and stub override so HM's hyprland module
# (which calls package.override { enableXWayland = ... }) doesn't error.
}) // {
passthru = (hyprland-pkgs.hyprland.passthru or {}) // {
providedSessions = [ "hyprland" ];
override = _: hyprland-wrapped;
};
override = _: hyprland-wrapped;
};
in
{