vm doesnt work with hyprland :(

This commit is contained in:
Kopatz
2024-07-05 15:41:34 +02:00
parent dccf8ee432
commit ad716578f5
2 changed files with 63 additions and 58 deletions

View File

@@ -1,73 +1,72 @@
{ config, pkgs, lib, inputs, ... }: { config, pkgs, lib, inputs, ... }:
with lib;
let cfg = config.custom.graphical.hyprland; let cfg = config.custom.graphical.hyprland;
in { in {
options.custom.graphical.hyprland = { options.custom.graphical.hyprland = {
enable = mkEnableOption "Enables hyprland"; enable = lib.mkEnableOption "Enables hyprland";
}; };
options.custom.graphical.hyprland.videobridge = { options.custom.graphical.hyprland.videobridge = {
enable = mkEnableOption "Enables xwaylandvideobridge for hyprland"; enable = lib.mkEnableOption "Enables xwaylandvideobridge for hyprland";
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.xserver = { services.xserver = {
xkb.layout = config.mainUser.layout; xkb.layout = config.mainUser.layout;
xkb.variant = config.mainUser.variant; xkb.variant = config.mainUser.variant;
enable = true; enable = true;
displayManager = displayManager =
mkIf (!config.services.xserver.displayManager.sddm.enable) { lib.mkIf (!config.services.xserver.displayManager.gdm.enable) {
gdm.enable = true; sddm.enable = true;
}; };
}; };
environment.sessionVariables = { environment.sessionVariables = {
WLR_NO_HARDWARE_CURSORS="1"; WLR_NO_HARDWARE_CURSORS = "1";
#WLR_DRM_NO_ATOMIC="1"; #WLR_DRM_NO_ATOMIC="1";
#WLR_DRM_DEVICES = "/dev/dri/card0"; #WLR_DRM_DEVICES = "/dev/dri/card0";
LIBVA_DRIVER_NAME="nvidia"; WLR_RENDERER_ALLOW_SOFTWARE = "1";
# black screen :( } // lib.mkIf config.custom.hardware.nvidia.enable {
#XDG_SESSION_TYPE = "wayland"; LIBVA_DRIVER_NAME = "nvidia";
GBM_BACKEND = "nvidia-drm"; # black screen :(
__GLX_VENDOR_LIBRARY_NAME = "nvidia"; #XDG_SESSION_TYPE = "wayland";
WLR_RENDERER_ALLOW_SOFTWARE="1"; GBM_BACKEND = "nvidia-drm";
}; __GLX_VENDOR_LIBRARY_NAME = "nvidia";
#WLR_BACKENDS="x11,way
hardware = { };
# Opengl
opengl.enable = true; hardware = {
# Opengl
# Most wayland compositors need this opengl.enable = true;
nvidia.modesetting.enable = true; # Most wayland compositors need this
}; nvidia.modesetting.enable =
lib.mkIf config.custom.hardware.nvidia.enable true;
xdg.portal.enable = true; };
xdg.portal.extraPortals = lib.mkDefault [ pkgs.xdg-desktop-portal-gtk ];
xdg.portal.enable = true;
programs.hyprland = { xdg.portal.extraPortals = lib.mkDefault [ pkgs.xdg-desktop-portal-gtk ];
enable = true;
}; programs.hyprland = { enable = true; };
security.pam.services.hyprlock = {}; security.pam.services.hyprlock = { };
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# hyprland stuff # hyprland stuff
dunst dunst
swww swww
rofi-wayland rofi-wayland
libnotify libnotify
networkmanagerapplet networkmanagerapplet
wayland wayland
wl-clipboard wl-clipboard
#qt5.qtwayland #qt5.qtwayland
#qt6.qmake #qt6.qmake
#qt6.qtwayland #qt6.qtwayland
#waybar #waybar
#xdg-desktop-portal-hyprland #xdg-desktop-portal-hyprland
#xdg-desktop-portal-gtk #xdg-desktop-portal-gtk
#xdg-utils #xdg-utils
#xwayland #xwayland
]; ];
}; };
} }

View File

@@ -18,7 +18,7 @@
}; };
graphical = { graphical = {
#i3.enable = true; #i3.enable = true;
plasma.enable = true; hyprland.enable = true;
#lightdm.enable = true; #lightdm.enable = true;
#sddm.enable = true; #sddm.enable = true;
#cosmic.enable = true; #cosmic.enable = true;
@@ -26,7 +26,13 @@
}; };
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
virtualisation.vmVariant = { virtualisation.vmVariant = {
virtualisation.qemu.options = [ "-vga qxl" ]; #virtualisation.qemu.options = [
# "-device virtio-vga-gl"
# "-display sdl,gl=on,show-cursor=off"
# "-audio pa,model=hda"
# #"-full-screen"
# ];
#virtualisation.qemu.options = [ "-vga qxl" ];
#[ "-vga none" "-device virtio-gpu-gl-pci" "-display default,gl=on" ]; #[ "-vga none" "-device virtio-gpu-gl-pci" "-display default,gl=on" ];
}; };