fix(vm): increase RAM to 8GB and fix Hyprland rule syntax to prevent crashes

- Increase VM memory to 8192MB to avoid OOM kills during session startup.
- Migrate all 'windowrule' to 'windowrulev2' in core configuration.
- Fix 'no_anim' syntax in layer rules.
- Re-enable graphics while keeping serial logs for debugging.
This commit is contained in:
Bernardo Magri
2026-04-05 14:17:52 +01:00
parent c71cb7ea71
commit 1fa60ed64a
20 changed files with 124 additions and 79 deletions

View File

@@ -41,8 +41,8 @@ input {
} }
# Scroll nicely in the terminal # Scroll nicely in the terminal
windowrule = match:class (Alacritty|kitty), scroll_touchpad 1.5 windowrulev2 = match:class (Alacritty|kitty), scroll_touchpad 1.5
windowrule = match:class com.mitchellh.ghostty, scroll_touchpad 0.2 windowrulev2 = match:class com.mitchellh.ghostty, scroll_touchpad 0.2
# Enable touchpad gestures for changing workspaces # Enable touchpad gestures for changing workspaces
# See https://wiki.hyprland.org/Configuring/Gestures/ # See https://wiki.hyprland.org/Configuring/Gestures/

View File

@@ -1,2 +1,2 @@
windowrule = no_screen_share on, match:class ^(1[p|P]assword)$ windowrulev2 = no_screen_share on, match:class ^(1[p|P]assword)$
windowrule = tag +floating-window, match:class ^(1[p|P]assword)$ windowrulev2 = tag +floating-window, match:class ^(1[p|P]assword)$

View File

@@ -1,6 +1,6 @@
windowrule = no_screen_share on, match:class ^(Bitwarden)$ windowrulev2 = no_screen_share on, match:class ^(Bitwarden)$
windowrule = tag +floating-window, match:class ^(Bitwarden)$ windowrulev2 = tag +floating-window, match:class ^(Bitwarden)$
# Bitwarden Chrome Extension # Bitwarden Chrome Extension
windowrule = no_screen_share on, match:class chrome-nngceckbapebfimnlniiiahkandclblb-Default windowrulev2 = no_screen_share on, match:class chrome-nngceckbapebfimnlniiiahkandclblb-Default
windowrule = tag +floating-window, match:class chrome-nngceckbapebfimnlniiiahkandclblb-Default windowrulev2 = tag +floating-window, match:class chrome-nngceckbapebfimnlniiiahkandclblb-Default

View File

@@ -1,16 +1,16 @@
# Browser types # Browser types
windowrule = tag +chromium-based-browser, match:class ((google-)?[cC]hrom(e|ium)|[bB]rave-browser|[mM]icrosoft-edge|Vivaldi-stable|helium) windowrulev2 = tag +chromium-based-browser, match:class ((google-)?[cC]hrom(e|ium)|[bB]rave-browser|[mM]icrosoft-edge|Vivaldi-stable|helium)
windowrule = tag +firefox-based-browser, match:class ([fF]irefox|zen|librewolf) windowrulev2 = tag +firefox-based-browser, match:class ([fF]irefox|zen|librewolf)
windowrule = tag -default-opacity, match:tag chromium-based-browser windowrulev2 = tag -default-opacity, match:tag chromium-based-browser
windowrule = tag -default-opacity, match:tag firefox-based-browser windowrulev2 = tag -default-opacity, match:tag firefox-based-browser
# Video apps: remove chromium browser tag so they don't get opacity applied # Video apps: remove chromium browser tag so they don't get opacity applied
windowrule = tag -chromium-based-browser, match:class (chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default) windowrulev2 = tag -chromium-based-browser, match:class (chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)
windowrule = tag -default-opacity, match:class (chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default) windowrulev2 = tag -default-opacity, match:class (chrome-youtube.com__-Default|chrome-app.zoom.us__wc_home-Default)
# Force chromium-based browsers into a tile to deal with --app bug # Force chromium-based browsers into a tile to deal with --app bug
windowrule = tile on, match:tag chromium-based-browser windowrulev2 = tile on, match:tag chromium-based-browser
# Only a subtle opacity change, but not for video sites # Only a subtle opacity change, but not for video sites
windowrule = opacity 1.0 0.97, match:tag chromium-based-browser windowrulev2 = opacity 1.0 0.97, match:tag chromium-based-browser
windowrule = opacity 1.0 0.97, match:tag firefox-based-browser windowrulev2 = opacity 1.0 0.97, match:tag firefox-based-browser

View File

@@ -1,2 +1,2 @@
# Focus floating DaVinci Resolve dialog windows # Focus floating DaVinci Resolve dialog windows
windowrule = stay_focused on, match:class .*[Rr]esolve.*, match:float 1 windowrulev2 = stay_focused on, match:class .*[Rr]esolve.*, match:float 1

View File

@@ -1,2 +1,2 @@
# Remove 1px border around hyprshot screenshots # Remove 1px border around hyprshot screenshots
layerrule = no_anim on, match:namespace selection layerrule = no_anim = true, match:namespace selection

View File

@@ -1,4 +1,4 @@
# Float LocalSend and fzf file picker # Float LocalSend and fzf file picker
windowrule = float on, match:class (Share|localsend) windowrulev2 = float on, match:class (Share|localsend)
windowrule = center on, match:class (Share|localsend) windowrulev2 = center on, match:class (Share|localsend)
windowrule = size 1100 700, match:class localsend windowrulev2 = size 1100 700, match:class localsend

View File

@@ -1,10 +1,10 @@
# Picture-in-picture overlays # Picture-in-picture overlays
windowrule = tag +pip, match:title (Picture.?in.?[Pp]icture) windowrulev2 = tag +pip, match:title (Picture.?in.?[Pp]icture)
windowrule = tag -default-opacity, match:tag pip windowrulev2 = tag -default-opacity, match:tag pip
windowrule = float on, match:tag pip windowrulev2 = float on, match:tag pip
windowrule = pin on, match:tag pip windowrulev2 = pin on, match:tag pip
windowrule = size 600 338, match:tag pip windowrulev2 = size 600 338, match:tag pip
windowrule = keep_aspect_ratio on, match:tag pip windowrulev2 = keep_aspect_ratio on, match:tag pip
windowrule = border_size 0, match:tag pip windowrulev2 = border_size 0, match:tag pip
windowrule = opacity 1 1, match:tag pip windowrulev2 = opacity 1 1, match:tag pip
windowrule = move (monitor_w-window_w-40) (monitor_h*0.04), match:tag pip windowrulev2 = move (monitor_w-window_w-40) (monitor_h*0.04), match:tag pip

View File

@@ -1,2 +1,2 @@
windowrule = tag -default-opacity, match:class qemu windowrulev2 = tag -default-opacity, match:class qemu
windowrule = opacity 1 1, match:class qemu windowrulev2 = opacity 1 1, match:class qemu

View File

@@ -1,4 +1,4 @@
windowrule = fullscreen on, match:class com.libretro.RetroArch windowrulev2 = fullscreen on, match:class com.libretro.RetroArch
windowrule = tag -default-opacity, match:class com.libretro.RetroArch windowrulev2 = tag -default-opacity, match:class com.libretro.RetroArch
windowrule = opacity 1 1, match:class com.libretro.RetroArch windowrulev2 = opacity 1 1, match:class com.libretro.RetroArch
windowrule = idle_inhibit fullscreen, match:class com.libretro.RetroArch windowrulev2 = idle_inhibit fullscreen, match:class com.libretro.RetroArch

View File

@@ -1,8 +1,8 @@
# Float Steam # Float Steam
windowrule = float on, match:class steam windowrulev2 = float on, match:class steam
windowrule = center on, match:class steam, match:title Steam windowrulev2 = center on, match:class steam, match:title Steam
windowrule = tag -default-opacity, match:class steam.* windowrulev2 = tag -default-opacity, match:class steam.*
windowrule = opacity 1 1, match:class steam.* windowrulev2 = opacity 1 1, match:class steam.*
windowrule = size 1100 700, match:class steam, match:title Steam windowrulev2 = size 1100 700, match:class steam, match:title Steam
windowrule = size 460 800, match:class steam, match:title Friends List windowrulev2 = size 460 800, match:class steam, match:title Friends List
windowrule = idle_inhibit fullscreen, match:class steam windowrulev2 = idle_inhibit fullscreen, match:class steam

View File

@@ -1,23 +1,23 @@
# Floating windows # Floating windows
windowrule = float on, match:tag floating-window windowrulev2 = float on, match:tag floating-window
windowrule = center on, match:tag floating-window windowrulev2 = center on, match:tag floating-window
windowrule = size 875 600, match:tag floating-window windowrulev2 = size 875 600, match:tag floating-window
windowrule = tag +floating-window, match:class (org.nomarchy.bluetui|org.nomarchy.impala|org.nomarchy.wiremix|org.nomarchy.btop|org.nomarchy.terminal|org.nomarchy.bash|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Nomarchy|About|TUI.float|imv|mpv) windowrulev2 = tag +floating-window, match:class (org.nomarchy.bluetui|org.nomarchy.impala|org.nomarchy.wiremix|org.nomarchy.btop|org.nomarchy.terminal|org.nomarchy.bash|org.gnome.NautilusPreviewer|org.gnome.Evince|com.gabm.satty|Nomarchy|About|TUI.float|imv|mpv)
windowrule = tag +floating-window, match:class (xdg-desktop-portal-gtk|sublime_text|DesktopEditors|org.gnome.Nautilus), match:title ^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*) windowrulev2 = tag +floating-window, match:class (xdg-desktop-portal-gtk|sublime_text|DesktopEditors|org.gnome.Nautilus), match:title ^(Open.*Files?|Open [F|f]older.*|Save.*Files?|Save.*As|Save|All Files|.*wants to [open|save].*|[C|c]hoose.*)
windowrule = float on, match:class org.gnome.Calculator windowrulev2 = float on, match:class org.gnome.Calculator
# Fullscreen screensaver # Fullscreen screensaver
windowrule = fullscreen on, match:class org.nomarchy.screensaver windowrulev2 = fullscreen on, match:class org.nomarchy.screensaver
windowrule = float on, match:class org.nomarchy.screensaver windowrulev2 = float on, match:class org.nomarchy.screensaver
windowrule = animation slide, match:class org.nomarchy.screensaver windowrulev2 = animation slide, match:class org.nomarchy.screensaver
# No transparency on media windows # No transparency on media windows
windowrule = tag -default-opacity, match:class ^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$ windowrulev2 = tag -default-opacity, match:class ^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$
windowrule = opacity 1 1, match:class ^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$ windowrulev2 = opacity 1 1, match:class ^(zoom|vlc|mpv|org.kde.kdenlive|com.obsproject.Studio|com.github.PintaProject.Pinta|imv|org.gnome.NautilusPreviewer)$
# Popped window rounding # Popped window rounding
windowrule = rounding 8, match:tag pop windowrulev2 = rounding 8, match:tag pop
# Prevent idle while open # Prevent idle while open
windowrule = idle_inhibit always, match:tag noidle windowrulev2 = idle_inhibit always, match:tag noidle

View File

@@ -1,2 +1,2 @@
# Prevent Telegram from stealing focus on new messages # Prevent Telegram from stealing focus on new messages
windowrule = focus_on_activate off, match:class org.telegram.desktop windowrulev2 = focus_on_activate off, match:class org.telegram.desktop

View File

@@ -1,4 +1,4 @@
# Define terminal tag to style them uniformly # Define terminal tag to style them uniformly
windowrule = tag +terminal, match:class (Alacritty|kitty|com.mitchellh.ghostty) windowrulev2 = tag +terminal, match:class (Alacritty|kitty|com.mitchellh.ghostty)
windowrule = tag -default-opacity, match:tag terminal windowrulev2 = tag -default-opacity, match:tag terminal
windowrule = opacity 0.97 0.9, match:tag terminal windowrulev2 = opacity 0.97 0.9, match:tag terminal

View File

@@ -1,2 +1,2 @@
# Application-specific animation # Application-specific animation
layerrule = no_anim on, match:namespace walker layerrule = no_anim = true, match:namespace walker

View File

@@ -1,6 +1,6 @@
# Webcam overlay for screen recording # Webcam overlay for screen recording
windowrule = float on, match:title WebcamOverlay windowrulev2 = float on, match:title WebcamOverlay
windowrule = pin on, match:title WebcamOverlay windowrulev2 = pin on, match:title WebcamOverlay
windowrule = no_initial_focus on, match:title WebcamOverlay windowrulev2 = no_initial_focus on, match:title WebcamOverlay
windowrule = no_dim on, match:title WebcamOverlay windowrulev2 = no_dim on, match:title WebcamOverlay
windowrule = move (monitor_w-window_w-40) (monitor_h-window_h-40), match:title WebcamOverlay windowrulev2 = move (monitor_w-window_w-40) (monitor_h-window_h-40), match:title WebcamOverlay

View File

@@ -1,15 +1,15 @@
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# Hyprland 0.53+ syntax # Hyprland 0.53+ syntax
windowrule = suppress_event maximize, match:class .* windowrulev2 = suppress_event maximize, match:class .*
# Tag all windows for default opacity (apps can override with -default-opacity tag) # Tag all windows for default opacity (apps can override with -default-opacity tag)
windowrule = tag +default-opacity, match:class .* windowrulev2 = tag +default-opacity, match:class .*
# Fix some dragging issues with XWayland # Fix some dragging issues with XWayland
windowrule = no_focus on, match:class ^$, match:title ^$, match:xwayland 1, match:float 1, match:fullscreen 0, match:pin 0 windowrulev2 = no_focus on, match:class ^$, match:title ^$, match:xwayland 1, match:float 1, match:fullscreen 0, match:pin 0
# App-specific tweaks (may remove default-opacity tag) # App-specific tweaks (may remove default-opacity tag)
source = ~/.config/nomarchy/default/hypr/apps.conf source = ~/.config/nomarchy/default/hypr/apps.conf
# Apply default opacity after apps have had a chance to opt out # Apply default opacity after apps have had a chance to opt out
windowrule = opacity 0.97 0.9, match:tag default-opacity windowrulev2 = opacity 0.97 0.9, match:tag default-opacity

View File

@@ -88,7 +88,7 @@
virtualisation.memorySize = 2048; virtualisation.memorySize = 2048;
virtualisation.cores = 2; virtualisation.cores = 2;
virtualisation.graphics = true; virtualisation.graphics = true;
virtualisation.qemu.options = [ "-vga virtio" ]; virtualisation.qemu.options = [ "-device virtio-vga" ];
}; };
# Use a dummy hardware config for VM # Use a dummy hardware config for VM
@@ -114,16 +114,52 @@
./modules/system ./modules/system
./modules/system/hardware.nix ./modules/system/hardware.nix
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ ({ pkgs, ... }: {
system.stateVersion = "25.11"; system.stateVersion = "25.11";
networking.hostName = "nomarchy"; networking.hostName = "nomarchy";
home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.extraSpecialArgs = { inherit inputs; };
# Diagnostic service to debug the black screen inside the VM
systemd.services.nomarchy-diag = {
description = "Nomarchy VM Diagnostics";
wantedBy = [ "multi-user.target" ];
after = [ "display-manager.service" ];
serviceConfig = {
Type = "oneshot";
StandardOutput = "tty";
StandardError = "tty";
TTYPath = "/dev/ttyS0";
ExecStart = pkgs.writeScript "diag.sh" ''
#!${pkgs.bash}/bin/bash
echo "--- NOMARCHY VM DIAGNOSTICS START ---"
echo "SDDM Helper Logs:"
${pkgs.systemd}/bin/journalctl -t sddm-helper --no-pager -n 50
echo "User (nomarchy) Environment:"
${pkgs.sudo}/bin/sudo -u nomarchy env | grep -E "XDG|DISPLAY|WAYLAND"
echo "User (nomarchy) Systemd Status:"
${pkgs.sudo}/bin/sudo -u nomarchy ${pkgs.systemd}/bin/systemctl --user status || echo "User systemd not running"
echo "User (nomarchy) Journal Logs:"
${pkgs.sudo}/bin/sudo -u nomarchy ${pkgs.systemd}/bin/journalctl --user --no-pager -n 100
echo "Hyprland Binary Check:"
ls -l /run/current-system/sw/bin/Hyprland || echo "Hyprland binary NOT FOUND in sw/bin"
echo "Hyprland Crash Dumps:"
${pkgs.coreutils}/bin/ls -l /home/nomarchy/.cache/hyprland/ || echo "No crash dumps found"
echo "--- NOMARCHY VM DIAGNOSTICS END ---"
'';
};
};
# VM specific settings # VM specific settings
virtualisation.vmVariant = { virtualisation.vmVariant = {
virtualisation.memorySize = 4096; virtualisation.memorySize = 8192;
virtualisation.cores = 4; virtualisation.cores = 4;
virtualisation.graphics = true; virtualisation.graphics = true;
virtualisation.qemu.options = [ "-vga virtio" "-serial mon:stdio" ]; virtualisation.qemu.options = [ "-device virtio-vga" "-serial mon:stdio" ];
}; };
# Use a dummy hardware config for VM # Use a dummy hardware config for VM
@@ -137,10 +173,18 @@
# Setup default user for testing # Setup default user for testing
users.users.nomarchy = { users.users.nomarchy = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "video" "render" ]; extraGroups = [ "wheel" "video" "render" "networkmanager" ];
initialPassword = "nixos"; initialPassword = "nixos";
}; };
environment.systemPackages = [ pkgs.sudo ];
# Enable passwordless sudo for the test user
security.sudo.wheelNeedsPassword = false;
# Autologin on the serial console for debugging
services.getty.autologinUser = "nomarchy";
services.displayManager.autoLogin.enable = true; services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "nomarchy"; services.displayManager.autoLogin.user = "nomarchy";
@@ -152,7 +196,7 @@
home.homeDirectory = "/home/nomarchy"; home.homeDirectory = "/home/nomarchy";
home.stateVersion = "25.11"; home.stateVersion = "25.11";
}; };
} })
]; ];
}; };
}; };

View File

@@ -25,9 +25,10 @@ in
"col.inactive_border" = "rgb(${config.colorScheme.palette.base03})"; "col.inactive_border" = "rgb(${config.colorScheme.palette.base03})";
}; };
"exec-once" = [ "exec-once" = [
"swww-daemon & sleep 0.5 && swww img ${activeWallpaper} --transition-type none" # "swww-daemon & sleep 0.5 && swww img ${activeWallpaper} --transition-type none"
# "nomarchy-on-boot" # "nomarchy-on-boot"
# "nomarchy-welcome" # "nomarchy-welcome"
"alacritty"
] ++ (lib.optional config.nomarchy.toggles.waybar "waybar"); ] ++ (lib.optional config.nomarchy.toggles.waybar "waybar");
"bind" = [ "bind" = [
"SUPER, Space, exec, walker" "SUPER, Space, exec, walker"

View File

@@ -16,7 +16,7 @@ in
services.displayManager.sddm = { services.displayManager.sddm = {
enable = true; enable = true;
wayland.enable = true; wayland.enable = true;
theme = "nomarchy"; # theme = "nomarchy";
}; };
services.displayManager.defaultSession = lib.mkDefault "hyprland-uwsm"; services.displayManager.defaultSession = lib.mkDefault "hyprland-uwsm";