Adding support for macbook hyprland

This commit is contained in:
ediblerope 2026-05-14 10:44:32 +01:00
parent a6b0bb55bb
commit 97bf8cd95a
3 changed files with 20 additions and 6 deletions

View file

@ -76,5 +76,10 @@
ExecStart = "${pkgs.networkmanager}/bin/nmcli networking connectivity check"; ExecStart = "${pkgs.networkmanager}/bin/nmcli networking connectivity check";
}; };
}; };
home-manager.users.fred = { ... }: {
wayland.windowManager.hyprland.settings.monitor =
[ "DP-2,3440x1440@180,0x0,1" ];
};
}; };
} }

View file

@ -20,5 +20,10 @@
boot.loader.systemd-boot.configurationLimit = 5; boot.loader.systemd-boot.configurationLimit = 5;
boot.initrd.systemd.enable = true; boot.initrd.systemd.enable = true;
home-manager.users.fred = { ... }: {
wayland.windowManager.hyprland.settings.monitor =
[ ",preferred,auto,auto" ];
};
}; };
} }

View file

@ -3,6 +3,13 @@
let let
hyprland-pkgs = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}; 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 # 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. # 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. # Use our nixpkgs GCC 15 to supply the missing symbol via LD_PRELOAD.
@ -37,7 +44,7 @@ let
}; };
in in
{ {
config = lib.mkIf (config.networking.hostName == "FredOS-Gaming") { config = lib.mkIf (lib.elem config.networking.hostName [ "FredOS-Gaming" "FredOS-Macbook" ]) {
programs.hyprland = { programs.hyprland = {
enable = true; enable = true;
xwayland.enable = true; xwayland.enable = true;
@ -97,11 +104,8 @@ in
package = hyprland-wrapped; package = hyprland-wrapped;
settings = { settings = {
monitor = "DP-2,3440x1440@180,0x0,1"; # monitor is set per-host in hosts/FredOS-{Gaming,Macbook}.nix
env = [ 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. # Keep these in sync with stylix.cursor in settings/stylix.nix.
"XCURSOR_THEME,Bibata-Modern-Ice" "XCURSOR_THEME,Bibata-Modern-Ice"
"XCURSOR_SIZE,24" "XCURSOR_SIZE,24"
@ -114,7 +118,7 @@ in
"QT_QPA_PLATFORM,wayland;xcb" # Qt apps, XWayland fallback "QT_QPA_PLATFORM,wayland;xcb" # Qt apps, XWayland fallback
"SDL_VIDEODRIVER,wayland" # SDL apps "SDL_VIDEODRIVER,wayland" # SDL apps
"_JAVA_AWT_WM_NONREPARENTING,1" # Java tiling fix "_JAVA_AWT_WM_NONREPARENTING,1" # Java tiling fix
]; ] ++ gpuEnv;
"$mod" = "SUPER"; "$mod" = "SUPER";
"$term" = "ghostty"; "$term" = "ghostty";