diff --git a/modules/graphical/hyprland.nix b/modules/graphical/hyprland.nix index 1a03f76..9d51ddc 100644 --- a/modules/graphical/hyprland.nix +++ b/modules/graphical/hyprland.nix @@ -1,73 +1,72 @@ { config, pkgs, lib, inputs, ... }: -with lib; let cfg = config.custom.graphical.hyprland; in { options.custom.graphical.hyprland = { - enable = mkEnableOption "Enables hyprland"; + enable = lib.mkEnableOption "Enables hyprland"; }; 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 = { xkb.layout = config.mainUser.layout; xkb.variant = config.mainUser.variant; enable = true; displayManager = - mkIf (!config.services.xserver.displayManager.sddm.enable) { - gdm.enable = true; + lib.mkIf (!config.services.xserver.displayManager.gdm.enable) { + sddm.enable = true; }; }; - - environment.sessionVariables = { - WLR_NO_HARDWARE_CURSORS="1"; - #WLR_DRM_NO_ATOMIC="1"; - #WLR_DRM_DEVICES = "/dev/dri/card0"; - LIBVA_DRIVER_NAME="nvidia"; - # black screen :( - #XDG_SESSION_TYPE = "wayland"; - GBM_BACKEND = "nvidia-drm"; - __GLX_VENDOR_LIBRARY_NAME = "nvidia"; - WLR_RENDERER_ALLOW_SOFTWARE="1"; - }; - - hardware = { - # Opengl - opengl.enable = true; - - # Most wayland compositors need this - nvidia.modesetting.enable = true; - }; - - xdg.portal.enable = true; - xdg.portal.extraPortals = lib.mkDefault [ pkgs.xdg-desktop-portal-gtk ]; - - programs.hyprland = { - enable = true; - }; - - security.pam.services.hyprlock = {}; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - # hyprland stuff - dunst - swww - rofi-wayland - libnotify - networkmanagerapplet - wayland - wl-clipboard - #qt5.qtwayland - #qt6.qmake - #qt6.qtwayland - #waybar - #xdg-desktop-portal-hyprland - #xdg-desktop-portal-gtk - #xdg-utils - #xwayland - ]; + + environment.sessionVariables = { + WLR_NO_HARDWARE_CURSORS = "1"; + #WLR_DRM_NO_ATOMIC="1"; + #WLR_DRM_DEVICES = "/dev/dri/card0"; + WLR_RENDERER_ALLOW_SOFTWARE = "1"; + } // lib.mkIf config.custom.hardware.nvidia.enable { + LIBVA_DRIVER_NAME = "nvidia"; + # black screen :( + #XDG_SESSION_TYPE = "wayland"; + GBM_BACKEND = "nvidia-drm"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + #WLR_BACKENDS="x11,way + }; + + hardware = { + # Opengl + opengl.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 ]; + + programs.hyprland = { enable = true; }; + + security.pam.services.hyprlock = { }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # hyprland stuff + dunst + swww + rofi-wayland + libnotify + networkmanagerapplet + wayland + wl-clipboard + #qt5.qtwayland + #qt6.qmake + #qt6.qtwayland + #waybar + #xdg-desktop-portal-hyprland + #xdg-desktop-portal-gtk + #xdg-utils + #xwayland + ]; }; } diff --git a/systems/vm/configuration.nix b/systems/vm/configuration.nix index 0266f34..3f70e43 100644 --- a/systems/vm/configuration.nix +++ b/systems/vm/configuration.nix @@ -18,7 +18,7 @@ }; graphical = { #i3.enable = true; - plasma.enable = true; + hyprland.enable = true; #lightdm.enable = true; #sddm.enable = true; #cosmic.enable = true; @@ -26,7 +26,13 @@ }; networking.networkmanager.enable = true; 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" ]; };