Skip to content
Hyprland on NixOS

Hyprland on NixOS

Installing Hyprland on NixOS

You can install Hyprland from:

  • The Nixpkgs repository if you want a proper released version from Hyprland.
  • The Hyprland flake if you want the latest git commit available at the moment.
  • Flake-compat if you want to use the Hyprland flake, but don’t want to enable the use of flakes in your NixOS system.
configuration.nix
{
  programs.hyprland.enable = true;
}

This will use the Hyprland version included in the Nixpkgs release you’re using.

Configuring Hyprland on NixOS

There are two ways to configure Hyprland in Nix declaratively. You can still do it imperatively by simply putting your hyprland.lua in ~/.config/hypr/. While that is not the recommended method, it is still an option in which neither of the two ways described below are needed.

Hjem

Hjem is a simple, lightweight home management tool designed for linking files into your home directory and setting systemd units and environment variables at the user level. Configuring Hyprland with Hjem.

Home Manager

Home Manager is a popular home management tool for Nix that comes with a lot of bells and whistles. It allows for configuring a range of apps with pure Nix code, which may be desired. Configuring Hyprland with Home Manager.

For the adventurous, @spikespaz has made a Hyprland module that can be used in Home Manager and NixOS. It can be found here.

Last updated on