From 28ef9220d92e045fd46e87392999fd431782f091 Mon Sep 17 00:00:00 2001 From: foxora Date: Fri, 6 Mar 2026 21:05:04 +0000 Subject: [PATCH] fixed gpu initialization order :3 --- homes/aurora/default.nix | 1 + homes/modules/wm/hyprland/hyprland.nix | 11 +++++--- hosts/nixarawrui/default.nix | 36 ++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/homes/aurora/default.nix b/homes/aurora/default.nix index e12dd41..7d636ba 100644 --- a/homes/aurora/default.nix +++ b/homes/aurora/default.nix @@ -86,6 +86,7 @@ # fonts nerd-fonts.departure-mono # pretty pixel art font i love!! x3 nerd-fonts.jetbrains-mono + noto-fonts # cli / tui tools and commands! eza # replaces: ls (rust) diff --git a/homes/modules/wm/hyprland/hyprland.nix b/homes/modules/wm/hyprland/hyprland.nix index ccd88d0..1cdc865 100644 --- a/homes/modules/wm/hyprland/hyprland.nix +++ b/homes/modules/wm/hyprland/hyprland.nix @@ -40,10 +40,6 @@ "wl-clip-persist --clipboard regular" "playerctld daemon" - - # swaps around the 3rd and 4th workspace because they always start - # in the wrong order - "hyprctl dispatch workspace 4 && hyprctl dispatch workspace 5 && hyprctl dispatch workspace 3 && hyprctl dispatch workspace 4 && hyprctl dispatch workspace 5 && hyprctl dispatch workspace 3 && hyprctl dispatch workspace 1" ]; # monitor configuration @@ -57,6 +53,13 @@ "HDMI-A-1, 1920x1080@60.00, -1920x0, 1" # tv ]; + workspace = [ + "1, monitor:DP-2, default:true" + "2, monitor:DP-3, default:true" + "3, monitor:HDMI-A-2, default:true" + "4, monitor:HDMI-A-1, default:true" + ]; + general = { gaps_in = 5; gaps_out = "0, 10, 10, 10"; diff --git a/hosts/nixarawrui/default.nix b/hosts/nixarawrui/default.nix index ead84ca..a86e456 100644 --- a/hosts/nixarawrui/default.nix +++ b/hosts/nixarawrui/default.nix @@ -1,5 +1,6 @@ { lib, + config, root, upkgs, ... @@ -25,6 +26,14 @@ # FIX: it said my disk was full kernelPackages = upkgs.linuxPackages_latest; kernelModules = ["v4l2loopback"]; + # force kernel to use dGPU + kernelParams = [ + "amdgpu.primary=0000:03:00.0" + "video=PCI:0000:03:00.0:e" + "initcall_blacklist=simpledrm_platform_driver_init" + "fbcon=map:0" + "pci=assign-busses" + ]; extraModulePackages = with kernelPackages; [v4l2loopback]; # qemu @@ -131,6 +140,30 @@ services = { displayManager.sddm.enable = true; displayManager.sddm.wayland.enable = true; + # force sddm to be on the dGPU + displayManager.sddm.wayland.compositor = "weston"; + displayManager.sddm.settings = let + xcfg = config.services.xserver; + # from: https://github.com/NixOS/nixpkgs/blob/1ad2d2e524cb1e7b91ebebcd10d224105dd4e1f2/nixos/modules/services/display-managers/sddm.nix#L132-L143 + # as for some reason they do it like this and it makes it harder for me to set the option correctly for my gpu + # NOTE: ask butterfly if there is a better way <3 + westonIni = (upkgs.formats.ini {}).generate "weston.ini" { + libinput = { + enable-tap = config.services.libinput.mouse.tapping; + left-handed = config.services.libinput.mouse.leftHanded; + }; + keyboard = { + keymap_model = xcfg.xkb.model; + keymap_layout = xcfg.xkb.layout; + keymap_variant = xcfg.xkb.variant; + keymap_options = xcfg.xkb.options; + }; + }; + in { + Wayland = { + CompositorCommand = "${lib.getExe upkgs.weston} --shell=kiosk --drm-device=card0 -c ${westonIni}"; + }; + }; udisks2.enable = true; flatpak.enable = true; @@ -301,6 +334,9 @@ # linux packages!!! linuxPackages.v4l2loopback + # weston is needed for sddm + weston + # android yay android-tools