My PC randomly crashes

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"
      ];
    };
  };
}