From 97bf8cd95ada6fa347dadd7da5605744624b27ae Mon Sep 17 00:00:00 2001 From: ediblerope Date: Thu, 14 May 2026 10:44:32 +0100 Subject: [PATCH] Adding support for macbook hyprland --- hosts/FredOS-Gaming.nix | 5 +++++ hosts/FredOS-Macbook.nix | 5 +++++ settings/hyprland.nix | 16 ++++++++++------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/hosts/FredOS-Gaming.nix b/hosts/FredOS-Gaming.nix index a463314..3cb02b4 100644 --- a/hosts/FredOS-Gaming.nix +++ b/hosts/FredOS-Gaming.nix @@ -76,5 +76,10 @@ ExecStart = "${pkgs.networkmanager}/bin/nmcli networking connectivity check"; }; }; + + home-manager.users.fred = { ... }: { + wayland.windowManager.hyprland.settings.monitor = + [ "DP-2,3440x1440@180,0x0,1" ]; + }; }; } diff --git a/hosts/FredOS-Macbook.nix b/hosts/FredOS-Macbook.nix index 1b3eda6..793ae94 100644 --- a/hosts/FredOS-Macbook.nix +++ b/hosts/FredOS-Macbook.nix @@ -20,5 +20,10 @@ boot.loader.systemd-boot.configurationLimit = 5; boot.initrd.systemd.enable = true; + + home-manager.users.fred = { ... }: { + wayland.windowManager.hyprland.settings.monitor = + [ ",preferred,auto,auto" ]; + }; }; } diff --git a/settings/hyprland.nix b/settings/hyprland.nix index b466dab..f24adcb 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -3,6 +3,13 @@ let hyprland-pkgs = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}; + # GPU pinning env vars — only needed on the dual-GPU gaming box (card1 = Navi 22). + gpuEnv = lib.optionals (config.networking.hostName == "FredOS-Gaming") [ + "AQ_DRM_DEVICES,/dev/dri/card1" + "WLR_DRM_DEVICES,/dev/dri/card1" + "DRI_PRIME,pci-0000_03_00_0" + ]; + # hyprutils-0.13.1 requires GLIBCXX_3.4.34 (GCC 15) but Hyprland's RPATH # was patched to gcc-14.3.0-lib which only provides up to GLIBCXX_3.4.33. # Use our nixpkgs GCC 15 to supply the missing symbol via LD_PRELOAD. @@ -37,7 +44,7 @@ let }; in { - config = lib.mkIf (config.networking.hostName == "FredOS-Gaming") { + config = lib.mkIf (lib.elem config.networking.hostName [ "FredOS-Gaming" "FredOS-Macbook" ]) { programs.hyprland = { enable = true; xwayland.enable = true; @@ -97,11 +104,8 @@ in package = hyprland-wrapped; settings = { - monitor = "DP-2,3440x1440@180,0x0,1"; + # monitor is set per-host in hosts/FredOS-{Gaming,Macbook}.nix env = [ - "AQ_DRM_DEVICES,/dev/dri/card1" - "WLR_DRM_DEVICES,/dev/dri/card1" - "DRI_PRIME,pci-0000_03_00_0" # Keep these in sync with stylix.cursor in settings/stylix.nix. "XCURSOR_THEME,Bibata-Modern-Ice" "XCURSOR_SIZE,24" @@ -114,7 +118,7 @@ in "QT_QPA_PLATFORM,wayland;xcb" # Qt apps, XWayland fallback "SDL_VIDEODRIVER,wayland" # SDL apps "_JAVA_AWT_WM_NONREPARENTING,1" # Java tiling fix - ]; + ] ++ gpuEnv; "$mod" = "SUPER"; "$term" = "ghostty";