fixed gpu initialization order :3

This commit is contained in:
foxora 2026-03-06 21:05:04 +00:00
parent 7f1f03f647
commit 28ef9220d9
3 changed files with 44 additions and 4 deletions

View file

@ -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)

View file

@ -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";

View file

@ -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