Hyprland

From NixOS Wiki
Revision as of 13:00, 10 October 2023 by imported>Niahex (Clarification of requires / add links to list of modules)

Hyprland is a wlroots-based tiling Wayland compositor written in C++. Noteworthy features of Hyprland include dynamic tiling, tabbed windows, a clean and readable C++ code-base, and a custom renderer that provides window animations, rounded corners, and Dual-Kawase Blur on transparent windows. General usage and configuration is thoroughly documented at Hyprland wiki.

Installation

For run Hyprland properly you need to enables critical components, such as:

If you use gdm or ldm: add a proper Desktop Entry to your her.

Using NixOS

 
/etc/nixos/home.nix
{pkgs, ...}: 
{
  programs.hyprland = {
    # Install the packages from nixpkgs
    enable = true;
    # Whether to enable XWayland
    xwayland = true;

    # Optional
    # Whether to enable patching wlroots for better Nvidia support
    enableNvidiaPatches = true;
  };
}

See all modules for NixOS

Using Home Manager

 
/etc/nixos/configuration.nix or ~/.config/home-manager/home.nix
{config, pkgs, ... }: 
{
  wayland.windowManager.hyprland = {
    # Whether to enable Hyprland wayland compositor
    enable = true;
    # The hyprland package to use
    package = pkgs.hyprland;
    # Whether to enable XWayland
    xwayland.enable = true;

    # Optional
    # Whether to enable hyprland-session.target on hyprland startup
    systemd.enable = true;
    # Whether to enable patching wlroots for better Nvidia support
    enableNvidiaPatches = true;

    # List of Hyprland plugins to use
    plugins = [
      split-monitor-workspaces
    ];

    # Hyprland configuration written in Nix
    settings = {
      decoration = {
        shadow_offset = "0 5";
        "col.shadow" = "rgba(00000099)";
      };

      "$mod" = "SUPER";

      bindm = [
        # mouse movements
        "$mod, mouse:272, movewindow"
        "$mod, mouse:273, resizewindow"
        "$mod ALT, mouse:272, resizewindow"
      ];
    };
  };
}

See all modules for Home Manager

Troubleshooting