My PC randomly crashes

Hello,
I am a complete beginner when it comes to nixos (I switched from endeavour not long ago). When I switched I used kde plasma and everything worked great but then I switched to try hyprland and for some reason my pc now randomly crashes. I haven’t been able to find any sort of pattern as to why it may crash nor have I been able to find any logs which might show where the crash lies. Here are my config files:

#flake.nix
{
  description = "My personal Hyprland NixOS config";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    nvf.url = "github:notashelf/nvf";
    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    hyprland.url = "github:hyprwm/Hyprland";
    hyprland-plugins = {
      url = "github:hyprwm/hyprland-plugins";
      inputs.hyprland.follows = "hyprland";
    };
    hyprpanel = {
      url = "github:Jas-SinghFSU/HyprPanel";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    stylix.url = "github:danth/stylix";
  };

  outputs = { self, nixpkgs, ... } @ inputs: {
    nixosConfigurations.max-main = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      specialArgs = { 
        inherit inputs;
      };
      modules = [
        ./configuration.nix
        ./hardware-configuration.nix
        inputs.home-manager.nixosModules.default
        inputs.stylix.nixosModules.stylix
      ];
    };
  };
}
#configuration.nix
{
  pkgs,
  inputs,
  ...
}: {
  nix.settings.experimental-features = ["nix-command" "flakes"];
  nixpkgs.config.allowUnfree = true;

  nixpkgs.overlays = [
    inputs.hyprpanel.overlay
    inputs.rust-overlay.overlays.default
  ];

  environment.systemPackages = [
    pkgs.nushell
    pkgs.wl-clipboard
    pkgs.rust-bin.stable.latest.default
    pkgs.xdg-desktop-portal-hyprland
    pkgs.xdg-desktop-portal-gtk
    pkgs.kdePackages.xdg-desktop-portal-kde
    pkgs.gvfs
  ];

  services.gvfs.enable = true;
  services.devmon.enable = true;

  programs.firefox.enable = true;

  programs.hyprland = {
    enable = true;
    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
    withUWSM = true;
  };

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  boot.kernelPackages = pkgs.linuxPackages_latest;

  networking.hostName = "max-main";
  networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
  networking.networkmanager.enable = true;

  environment.sessionVariables = {
    XDG_CURRENT_DESKTOP = "Hyprland";
  };

  time.timeZone = "Europe/Prague";
  i18n.defaultLocale = "en_US.UTF-8";
  i18n.extraLocaleSettings = {
    LC_ADDRESS = "cs_CZ.UTF-8";
    LC_IDENTIFICATION = "cs_CZ.UTF-8";
    LC_MEASUREMENT = "cs_CZ.UTF-8";
    LC_MONETARY = "cs_CZ.UTF-8";
    LC_NAME = "cs_CZ.UTF-8";
    LC_NUMERIC = "cs_CZ.UTF-8";
    LC_PAPER = "cs_CZ.UTF-8";
    LC_TELEPHONE = "cs_CZ.UTF-8";
    LC_TIME = "cs_CZ.UTF-8";
  };

  services.xserver.enable = true;
  services.printing.enable = true;
  services.displayManager.sddm.enable = true;
  services.xserver.xkb = {
    layout = "cz";
    variant = "";
    options = "caps:escape";
  };

  console.keyMap = "cz-lat2";

  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    jack.enable = true;
  };

  system.activationScripts.cleanBackups = ''
    echo "Removing .backup_nix files..."
    find /home/maxag -type f -name "*.backup_nix" -delete
  '';

  users.users.maxag = {
    isNormalUser = true;
    description = "Max Ag";
    extraGroups = ["networkmanager" "wheel" "video"];

    shell = pkgs.nushell;
  };

  home-manager = {
    useUserPackages = true;
    useGlobalPkgs = true;

    extraSpecialArgs = {inherit inputs;};
    backupFileExtension = "backup_nix";

    users.maxag = {
      imports = [
        ./home.nix
      ];
    };
  };

  programs.steam = {
    enable = true;
    remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
    dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
    localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
  };

  system.stateVersion = "25.05";
}
#home.nix
{
  pkgs,
  inputs,
  ...
}: {
  home.username = "maxag";
  home.homeDirectory = "/home/maxag";

  imports = [
    inputs.hyprpanel.homeManagerModules.hyprpanel
    inputs.nvf.homeManagerModules.default
  ];

  programs.home-manager.enable = true;
  home.stateVersion = "25.05";

  home.sessionVariables.NIXOS_OZONE_WL = "1";

  wayland.windowManager.hyprland = {
    enable = true;
    systemd.enable = true;
    systemd.variables = ["--all"];
    package = null;

    xwayland.enable = true;

    settings = {
      exec-once = [
        "dbus-update-activation-environment --all --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
        "systemctl --user restart xdg-desktop-portal"

        "wl-clip-persist --clipboard both &"
        "wl-paste --watch cliphist store &"
      ];

      input = {
        kb_layout = "cz";
        kb_options = "caps:escape";
        numlock_by_default = true;

        sensitivity = 0;
        touchpad = {
          natural_scroll = true;
        };
      };

      misc = {
        disable_hyprland_logo = true;
        layers_hog_keyboard_focus = true;
        animate_manual_resizes = true;
        enable_swallow = true;
        focus_on_activate = true;
        middle_click_paste = false;
      };

      dwindle = {
        force_split = 0;
        special_scale_factor = 1.0;
        split_width_multiplier = 1.0;
        use_active_for_splits = true;
        pseudotile = "yes";
        preserve_split = "yes";
      };

      general = {
        "$mainMod" = "SUPER";
        layout = "dwindle";
        gaps_in = 5;
        gaps_out = 5;
        border_size = 3;
        no_border_on_floating = false;
      };

      decoration = {
        rounding = 7;
        active_opacity = 1.0;
        inactive_opacity = 1.0;
        fullscreen_opacity = 1.0;

        blur.enabled = false;
        shadow.enabled = false;
      };

      animations = {
        enabled = true;

        bezier = [
          "myBezier, 0.05, 0.9, 0.1, 1.05"
        ];

        animation = [
          "windows, 1, 7, myBezier"
          "windowsOut, 1, 7, default, popin 80%"
          "border, 1, 10, default"
          "borderangle, 1, 8, default"
          "fade, 1, 7, default"
          "workspaces, 1, 6, default"
        ];
      };

      binds = {
        movefocus_cycles_fullscreen = true;
      };

      bind = [
        # keybindings
        "$mainMod, Return, exec, foot"
        "$mainMod, B, exec, firefox"
        "$mainMod, Q, killactive,"
        "$mainMod, F, fullscreen, 0"
        "$mainMod SHIFT, F, fullscreen, 1"
        "$mainMod, W, togglefloating"
        "$mainMod, A, exec, fuzzel"
        "$mainMod, P, pseudo,"
        "$mainMod, E, exec, dolphin"
        "$mainMod, C, exec, hyprpicker -a"
        "$mainMod, code:23, swapsplit"
        "$mainMod, code:66, togglesplit"

        # switch focus
        "$mainMod, left,  movefocus, l"
        "$mainMod, right, movefocus, r"
        "$mainMod, up,    movefocus, u"
        "$mainMod, down,  movefocus, d"
        "$mainMod, h, movefocus, l"
        "$mainMod, j, movefocus, d"
        "$mainMod, k, movefocus, u"
        "$mainMod, l, movefocus, r"

        "$mainMod, left,  alterzorder, top"
        "$mainMod, right, alterzorder, top"
        "$mainMod, up,    alterzorder, top"
        "$mainMod, down,  alterzorder, top"
        "$mainMod, h, alterzorder, top"
        "$mainMod, j, alterzorder, top"
        "$mainMod, k, alterzorder, top"
        "$mainMod, l, alterzorder, top"

        # switch workspace
        "$mainMod, code:10, workspace, 1"
        "$mainMod, code:11, workspace, 2"
        "$mainMod, code:12, workspace, 3"
        "$mainMod, code:13, workspace, 4"
        "$mainMod, code:14, workspace, 5"
        "$mainMod, code:15, workspace, 6"
        "$mainMod, code:16, workspace, 7"
        "$mainMod, code:17, workspace, 8"
        "$mainMod, code:18, workspace, 9"
        "$mainMod, code:19, workspace, 10"

        # same as above, but switch to the workspace
        "$mainMod SHIFT, code:10, movetoworkspacesilent, 1"
        "$mainMod SHIFT, code:11, movetoworkspacesilent, 2"
        "$mainMod SHIFT, code:12, movetoworkspacesilent, 3"
        "$mainMod SHIFT, code:13, movetoworkspacesilent, 4"
        "$mainMod SHIFT, code:14, movetoworkspacesilent, 5"
        "$mainMod SHIFT, code:15, movetoworkspacesilent, 6"
        "$mainMod SHIFT, code:16, movetoworkspacesilent, 7"
        "$mainMod SHIFT, code:17, movetoworkspacesilent, 8"
        "$mainMod SHIFT, code:18, movetoworkspacesilent, 9"
        "$mainMod SHIFT, code:19, movetoworkspacesilent, 10"

        # window control
        "$mainMod SHIFT, left, movewindow, l"
        "$mainMod SHIFT, right, movewindow, r"
        "$mainMod SHIFT, up, movewindow, u"
        "$mainMod SHIFT, down, movewindow, d"
        "$mainMod SHIFT, h, movewindow, l"
        "$mainMod SHIFT, j, movewindow, d"
        "$mainMod SHIFT, k, movewindow, u"
        "$mainMod SHIFT, l, movewindow, r"

        "$mainMod CTRL, left, resizeactive, -80 0"
        "$mainMod CTRL, right, resizeactive, 80 0"
        "$mainMod CTRL, up, resizeactive, 0 -80"
        "$mainMod CTRL, down, resizeactive, 0 80"
        "$mainMod CTRL, h, resizeactive, -80 0"
        "$mainMod CTRL, j, resizeactive, 0 80"
        "$mainMod CTRL, k, resizeactive, 0 -80"
        "$mainMod CTRL, l, resizeactive, 80 0"

        "$mainMod ALT, left, moveactive,  -80 0"
        "$mainMod ALT, right, moveactive, 80 0"
        "$mainMod ALT, up, moveactive, 0 -80"
        "$mainMod ALT, down, moveactive, 0 80"
        "$mainMod ALT, h, moveactive,  -80 0"
        "$mainMod ALT, j, moveactive, 0 80"
        "$mainMod ALT, k, moveactive, 0 -80"
        "$mainMod ALT, l, moveactive, 80 0"

        # media and volume controls
        # ",XF86AudioMute,exec, pamixer -t"
        ",XF86AudioPlay,exec, playerctl play-pause"
        ",XF86AudioNext,exec, playerctl next"
        ",XF86AudioPrev,exec, playerctl previous"
        ",XF86AudioStop,exec, playerctl stop"
      ];

      # mouse binding
      bindm = [
        "$mainMod, mouse:272, movewindow"
        "$mainMod, mouse:273, resizewindow"
      ];

      windowrule = [
        # "float,class:^(mpv)$"
      ];

      workspace = [
        "1, monitor:DP-1"
        "2, monitor:DP-2"
      ];
    };

    extraConfig = "
      monitor=DP-1,2560x1440@120,0x0,1
      monitor=DP-2,1920x1080@60,-1920x300,1

      debug:disable_logs = false

      xwayland {
        force_zero_scaling = true
      }
    ";
  };
  programs.hyprpanel = {
    enable = true;
    hyprland.enable = true;
    overwrite.enable = true;

    settings = {
      bar.launcher.autoDetectIcon = true;
      bar.workspaces.show_icons = true;

      menus.clock = {
        time = {
          military = true;
          hideSeconds = true;
        };
        weather.unit = "metric";
      };

      menus.dashboard.directories.enabled = false;
      menus.dashboard.stats.enable_gpu = true;

      theme.bar.transparent = true;
    };
  };

  home.packages = [
    pkgs.libreoffice
    pkgs.hyprpicker
    pkgs.wl-clip-persist
    pkgs.cliphist
    pkgs.wf-recorder
    pkgs.slurp
    pkgs.grim
    pkgs.wl-clipboard
    pkgs.fuzzel

    pkgs.kdePackages.kate
    pkgs.kdePackages.dolphin
    pkgs.kdePackages.ark
    pkgs.trilium-next-desktop

    pkgs.dotnetCorePackages.sdk_8_0_3xx-bin
    pkgs.oh-my-posh
    pkgs.zellij
    pkgs.gcc
    pkgs.wineWowPackages.staging
    pkgs.btop
    pkgs.fastfetch

    pkgs.krita
    pkgs.mpv
    pkgs.inkscape

    pkgs.discord
    pkgs.heroic
    (pkgs.prismlauncher.override {
      jdks = [
        pkgs.temurin-bin-21
        pkgs.temurin-bin-8
        pkgs.temurin-bin-17
      ];
    })
    pkgs.godot
  ];

  programs.fuzzel.enable = true;
  programs.btop.enable = true;

  stylix = {
    enable = true;
    base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-macchiato.yaml";
    cursor = {
      package = pkgs.bibata-cursors;
      name = "Bibata-Modern-Ice";
      size = 14;
    };

    fonts = {
      sizes = {
        applications = 10;
        desktop = 10;
        terminal = 9;
        popups = 8;
      };

      monospace = {
        package = pkgs.nerd-fonts.jetbrains-mono;
        name = "JetBrainsMono Nerd Font Mono";
      };

      sansSerif = {
        package = pkgs.dejavu_fonts;
        name = "DejaVu Sans";
      };

      serif = {
        package = pkgs.dejavu_fonts;
        name = "DejaVu Serif";
      };
    };

    polarity = "dark";

    image = ./assets/wallpaper.png;
  };

  programs.zellij.enable = true;
  programs.zellij.enableBashIntegration = false;

  programs.nvf = {
    enable = true;

    settings.vim = {
      useSystemClipboard = true;
      diagnostics.config.virtual_text = true;

      options = {
        tabstop = 2;
        autoindent = true;
        shiftwidth = 2;
      };

      statusline.lualine.enable = true;
      telescope.enable = true;
      autocomplete.nvim-cmp.enable = true;

      languages = {
        enableLSP = true;
        enableTreesitter = true;
        enableFormat = true;

        html.enable = true;
        html.treesitter.autotagHtml = true;

        nix.enable = true;
        rust.enable = true;
        ts.enable = true;
        csharp.enable = true;
        zig.enable = true;
      };
    };
  };

  programs.foot = {
    enable = true;
    settings.main = {
      term = "xterm-256color";
    };
  };

  programs.git = {
    enable = true;

    userEmail = ""; # intentionally deleted
    userName = ""; # intentionally deleted

    extraConfig.credential.helper = "store";
    extraConfig.credential."https://github.com".username = "maxstrb";

    extraConfig = {
      init.defaultBranch = "main";
    };
  };

  programs.nushell = {
    enable = true;

    extraConfig = ''
      if "ZELLIJ" in $env == false {
        zellij
        exit
      }

      def garbage [] {
        sudo nix-collect-garbage --delete-old
        sudo nixos-rebuild switch --flake /home/maxag/.nix-config
      }
    '';

    settings = {
      show_banner = false;
    };

    shellAliases = {
      c = "clear";
      zel = "zellij";
      rebuild = "sudo nixos-rebuild switch --flake /home/maxag/.nix-config";
      home = "nvim /home/maxag/.nix-config/home.nix";
      config = "nvim /home/maxag/.nix-config/configuration.nix";
    };
  };

  programs.oh-my-posh = {
    enable = true;

    useTheme = "catppuccin_macchiato";

    enableNushellIntegration = true;
    enableBashIntegration = true;
  };
  programs.bash.enable = true;

  home.file.".config/kdeglobals".text = ''
    [General]
    TerminalApplication=foot
  '';
}

I am posting the whole thing because I have no idea why the crash my occur so I don’t want to leave anything out.

Also anytime I rebuild I get this message

evaluation warning: maxag profile: xdg-desktop-portal 1.17 reworked how portal implementations are loaded, you
                    should either set `xdg.portal.config` or `xdg.portal.configPackages`
                    to specify which portal backend to use for the requested interface.

                    https://github.com/flatpak/xdg-desktop-portal/blob/37a6f7c8b8e08b9861f05e172cd4e0d07a832c4d/doc/portals.conf.rst.in

                    If you simply want to keep the behaviour in < 1.17, which uses the first
                    portal implementation found in lexicographical order, use the following:

                    xdg.portal.config.common.default = "*";

I would be grateful to anyone who might suggest where to look or what to check.
(Also if you think I should change something about my config files as a whole I would love any tips from more experienced nixos users)

I cannot comment on your config but random crashes without any logs are going to be very difficult to troubleshoot. What happens just before the crash in the logs?
You can inspect the logs of your previous session with journalctl -b -1 (and add -e to get directly to the end, which is probably more relevant).

2 Likes

If you need some reference for hyprland: Minimal Hyprland + Waybar setup


For home.nix, few things to adjust maybe.

These parts:

{
  # home.nix
  home.sessionVariables.NIXOS_OZONE_WL = "1";

  wayland.windowManager.hyprland = {
    systemd.variables = ["--all"];

    settings = {
      exec-once = [
        "dbus-update-activation-environment --all --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP"
        "wl-clip-persist --clipboard both &"
        "wl-paste --watch cliphist store &"
      ];
    };
  };
}

To replace with:

{
  # home.nix
  wayland.windowManager.hyprland = {
    systemd.variables = ["--all"];

    settings = {
      exec-once = [
        # "dbus-update-activation-environment --all --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" # `systemd.variables = ["--all"];` does that already
        "wl-clip-persist --clipboard both" # not sure why need `&` at the end?
        "wl-paste --watch cliphist store" # not sure why need `&` at the end?
      ];
      # set session.variables here instead to make them available for `hyprland`
      env = [
        "NIXOS_OZONE_WL, 1"
        "XDG_CURRENT_DESKTOP, Hyprland"
        "WAYLAND_DISPLAY, $SOME_VALUE"

        # to add
        "XDG_SESSION_DESKTOP, Hyprland"
      ];
    };
  };
}
kvě 03 15:47:27 max-main systemd[1788]: Started Virtual filesystem service - disk device monitor.
kvě 03 15:47:27 max-main systemd[1788]: Starting Virtual filesystem service - Apple File Conduit monitor...
kvě 03 15:47:27 max-main systemd[1788]: Started Virtual filesystem service - Apple File Conduit monitor.
kvě 03 15:47:27 max-main systemd[1788]: Starting Virtual filesystem service - digital camera monitor...
kvě 03 15:47:27 max-main systemd[1788]: Started Virtual filesystem service - digital camera monitor.
kvě 03 15:47:27 max-main systemd[1788]: Starting Virtual filesystem service - Media Transfer Protocol monitor...
kvě 03 15:47:27 max-main systemd[1788]: Started Virtual filesystem service - Media Transfer Protocol monitor.
kvě 03 15:47:27 max-main systemd[1788]: Starting Virtual filesystem service - GNOME Online Accounts monitor...
kvě 03 15:47:27 max-main systemd[1788]: Started Virtual filesystem service - GNOME Online Accounts monitor.
kvě 03 15:47:27 max-main wireplumber[2086]: default: Failed to get percentage from UPower: org.freedesktop.DBus.Error.NameHasNoOwner
kvě 03 15:47:27 max-main wireplumber[2086]: spa.bluez5: BlueZ system service is not available
kvě 03 15:47:27 max-main wireplumber[2086]: [0:00:54.377700974] [2086]  INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/nix/store/src/ipa' to the IPA search path
kvě 03 15:47:27 max-main wireplumber[2086]: [0:00:54.379406200] [2086]  INFO Camera camera_manager.cpp:327 libcamera v0.4.0
kvě 03 15:47:27 max-main systemd[1]: Starting Hostname Service...
kvě 03 15:47:27 max-main .gvfsd-wsdd-wra[2259]: Failed to spawn the wsdd daemon: Failed to execute child process “wsdd” (No such file or directory)
kvě 03 15:47:27 max-main .gvfsd-network-[2246]: Couldn't create directory monitor on wsdd:///. Error: Automount failed: Failed to spawn the underlying wsdd daemon.
kvě 03 15:47:27 max-main systemd[1]: Started Hostname Service.
kvě 03 15:47:27 max-main systemd-timesyncd[661]: Contacted time server 93.99.104.53:123 (2.nixos.pool.ntp.org).
kvě 03 15:47:28 max-main wireplumber[2086]: s-monitors-utils: skipping device libcamera:\_SB_.PCI0.GP17.XHC0.RHUB.PRT2-2:1.0-0c45:6340
kvě 03 15:47:35 max-main systemd[1]: Stopping User Manager for UID 175...
kvě 03 15:47:35 max-main systemd[1566]: Activating special unit Exit the Session...
kvě 03 15:47:35 max-main systemd[1566]: Stopped target Main User Target.
kvě 03 15:47:35 max-main systemd[1566]: Stopping devmon automatic device mounting daemon...
kvě 03 15:47:35 max-main devmon[1575]: device: [/dev/sda1]
kvě 03 15:47:35 max-main devmon[1575]:     systeminternal: [0]
kvě 03 15:47:35 max-main devmon[1575]:     usage:          [filesystem]
kvě 03 15:47:35 max-main devmon[1575]:     type:           [ext4]
kvě 03 15:47:35 max-main devmon[1575]:     label:          [VerbatimSSD]
kvě 03 15:47:35 max-main devmon[1575]:     ismounted:      [1]
kvě 03 15:47:35 max-main devmon[1575]:     nopolicy:       [0]
kvě 03 15:47:35 max-main devmon[1575]:     hasmedia:       [1]
kvě 03 15:47:35 max-main devmon[1575]:     opticaldisc:    []
kvě 03 15:47:35 max-main devmon[1575]:     numaudiotracks: []
kvě 03 15:47:35 max-main devmon[1575]:     blank:          []
kvě 03 15:47:35 max-main devmon[1575]:     media:          []
kvě 03 15:47:35 max-main devmon[1575]:     partition:      [1]
kvě 03 15:47:35 max-main devmon[1575]: devmon: [on exit] /nix/store/c6c3bw87gm8xadyhxhbkvcdyl7xm27nl-udisks-2.10.1/bin/udisksctl unmount -b /dev/sda1 &
kvě 03 15:47:35 max-main devmon[1575]: devmon: stopped
kvě 03 15:47:35 max-main systemd[1566]: Stopped devmon automatic device mounting daemon.
kvě 03 15:47:35 max-main systemd[1566]: Stopped target Basic System.
kvě 03 15:47:35 max-main systemd[1566]: Stopped target Paths.
kvě 03 15:47:35 max-main systemd[1566]: Stopped target Sockets.
kvě 03 15:47:35 max-main systemd[1566]: Stopped target Timers.
kvě 03 15:47:35 max-main systemd[1566]: Closed PipeWire PulseAudio.
kvě 03 15:47:35 max-main systemd[1566]: Closed PipeWire Multimedia System Sockets.
kvě 03 15:47:35 max-main dbus-broker[1598]: Dispatched 254 messages @ 0(±1)μs / message.
kvě 03 15:47:35 max-main systemd[1566]: Stopping D-Bus User Message Bus...
kvě 03 15:47:35 max-main systemd[1566]: Stopped D-Bus User Message Bus.
kvě 03 15:47:35 max-main systemd[1566]: Removed slice User Core Session Slice.
kvě 03 15:47:35 max-main systemd[1566]: Closed D-Bus User Message Bus Socket.
kvě 03 15:47:35 max-main systemd[1566]: Removed slice User Application Slice.
kvě 03 15:47:35 max-main systemd[1566]: Reached target Shutdown.
kvě 03 15:47:35 max-main systemd[1566]: Finished Exit the Session.
kvě 03 15:47:35 max-main systemd[1566]: Reached target Exit the Session.
kvě 03 15:47:35 max-main (sd-pam)[1568]: pam_unix(systemd-user:session): session closed for user sddm
kvě 03 15:47:35 max-main systemd-logind[1030]: Removed session 1.
kvě 03 15:47:35 max-main systemd[1]: user@175.service: Deactivated successfully.
kvě 03 15:47:35 max-main systemd[1]: Stopped User Manager for UID 175.
kvě 03 15:47:35 max-main systemd[1]: user@175.service: Consumed 251ms CPU time, 19.1M memory peak, 6.9M read from disk.
kvě 03 15:47:35 max-main systemd[1]: Stopping User Runtime Directory /run/user/175...
kvě 03 15:47:35 max-main systemd[1]: run-user-175.mount: Deactivated successfully.
kvě 03 15:47:35 max-main systemd[1]: user-runtime-dir@175.service: Deactivated successfully.
kvě 03 15:47:35 max-main systemd[1]: Stopped User Runtime Directory /run/user/175.
kvě 03 15:47:57 max-main systemd[1]: systemd-hostnamed.service: Deactivated successfully.
kvě 03 15:57:23 max-main systemd[1788]: Started PipeWire PulseAudio.
kvě 03 15:57:23 max-main .xdg-desktop-po[1982]: Realtime error: Could not get pidns: Could not fstatat ns/pid: Not a directory
kvě 03 15:57:23 max-main .xdg-desktop-po[1982]: Realtime error: Could not get pidns: Could not fstatat ns/pid: Not a directory
kvě 03 15:57:33 max-main systemd[1]: Starting Time & Date Service...
kvě 03 15:57:33 max-main systemd[1]: Started Time & Date Service.
kvě 03 15:57:33 max-main systemd-timesyncd[661]: Contacted time server 93.99.104.53:123 (2.nixos.pool.ntp.org).
kvě 03 15:57:33 max-main rtkit-daemon[2034]: Successfully made thread 6381 of process 6234 owned by '1000' RT at priority 10.
kvě 03 15:57:39 max-main rtkit-daemon[2034]: Successfully made thread 6726 of process 6508 owned by '1000' RT at priority 10.
kvě 03 15:57:42 max-main prismlauncher[6782]: QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix
kvě 03 15:58:03 max-main systemd[1]: systemd-timedated.service: Deactivated successfully.
kvě 03 15:58:29 max-main java[7169]: pw.conf: setting config.name to client-rt.conf is deprecated, using client.conf
kvě 03 15:58:31 max-main .xdg-desktop-po[1982]: Realtime error: Could not get pidns: Could not fstatat ns/pid: Not a directory

This is the output of journalctl with -e. I have a hard time understanding the output but from what I can see all these messages are from the pc booting up not shutting down/restarting. (kvě 03 …, is because of my locale (czech))

Thank you for spending your time helping me :slight_smile:

First of all I want to really thank you for taking the time to answer me. I am going to try it right now. Could I also ask if you know anything about this:

evaluation warning: maxag profile: xdg-desktop-portal 1.17 reworked how portal implementations are loaded, you
                    should either set `xdg.portal.config` or `xdg.portal.configPackages`
                    to specify which portal backend to use for the requested interface.

                    https://github.com/flatpak/xdg-desktop-portal/blob/37a6f7c8b8e08b9861f05e172cd4e0d07a832c4d/doc/portals.conf.rst.in

                    If you simply want to keep the behaviour in < 1.17, which uses the first
                    portal implementation found in lexicographical order, use the following:

                    xdg.portal.config.common.default = "*";

Thanks in advance.

The log you’ve submitted does not seem to contain anything dramatic.

Are you sure this is a log of the problematic session? -b -1 means “one boot ago”, so you might have to go further in the past if you’ve booted many times since.

When you say “pc crashes”, what are the symptom and how do you recover?

I am 100% sure that I ran the command just after the PC crashed.
I got pretty much the same output multiple times after different crashes.

As to what I mean by crash. Randomly, it could by after hours after booting up or just after 5 minutes, the screen turns black and after like 3 second I get to the system generation selection screen (where I select with nixos generation I want to use, I can’t remember the name of it). The PC boots up again just fine.

As to when this happens I just can’t find any specific reason. Sometimes it happens in the middle of competitive match any sometimes if am just in working on my project in vim with no other window open.

Should I also post hyprland logs?

Thank you for your help. I really appreciate it.

I would keep digging in the logs if I were you, except pressing a hardware reset button I can’t imagine why the reboot wouldn’t show up.

I have not used hyprland but if you strongly suspect it’s the cause, you can try going back to KDE to confirm it really doesn’t happen there.

You prolly can check that on google? Also for error messages from log
Does your system actually rebuilds with that warning or it does fail?

Check docs for hyprland and xdg portals: Environment variables – Hyprland Wiki
and suggestion for changes, your config doesn’t set any ENV for hyprland to use

As mentioned the logs are very important. You can try posting the whole journlactl log and dmesg log of the session that crashed. Therefor use pastbin.com and share the link.
Furthermore can you post the hyprland log. This should be located at $HOME/.cache/hyprland.
To rule out possible Hardware issues, have you any other OS installed and if so do you have the crashes there too?

Looked it up multiple time trying different parts of the error yet I can’t really find a fix.
It is just a warning and the system compiles just find. I just find it weird that it is there. I have no idea what part of my config is wrong…

Have you tried with the config I’ve shared in previous post?