Skip to content
Hyprland on any distro using Nix

Hyprland on any distro using Nix

Using Hyprland via the Nix package manager on distros that aren’t NixOS is very simple.

Installing Nix

The first step is to install Nix itself. There are two primary ways to install the Nix package manager:

Nix upstream recommends the multi-user installer, which can be found in their official documentation. It operates outside of your package manager’s control and modifies your shell profiles directly. Uninstalling this method is harder. The install script requires a distro that uses systemd.

Installing Hyprland

Before you do anything, enable flakes, by adding this to /etc/nix/nix.conf or ~/.config/nix/nix.conf:

experimental-features = nix-command flakes

Once that is done, install Hyprland through nix profile:

Installing Hyprland (and other hypr* tools) can be done like so:

sudo nix profile add --profile /nix/var/nix/profiles/default github:hyprwm/hyprnix#hyprland

Replace #hyprland with a different app from the flake to install it (e.g. #hyprpaper)

Since you’re using Hyprland outside of NixOS, it won’t be able to find graphics drivers. To get around that, you can use nixGL.

Just install it like so:

sudo nix profile add --profile /nix/var/nix/profiles/default github:guibou/nixGL --impure

--impure is needed due to nixGL’s reliance on hardware information.

Since 0.53.2, start-hyprland will automatically use nixGL if needed. For versions before that, you must use nixGL start-hyprland.

Lastly, if you are using a Login Manager, like SDDM or GDM, you need to symlink the .desktop file like so:

sudo mkdir -p /usr/share/wayland-sessions
sudo ln -sf /nix/var/nix/profiles/default/share/wayland-sessions/hyprland.desktop /usr/share/wayland-sessions/hyprland.desktop

so that the login manager can find Hyprland.

Upgrading / updating

In order to upgrade all your packages, you can run:

sudo nix profile upgrade --profile /nix/var/nix/profiles/default '.*'

Check the Nix profile command documentation for other upgrade options if that interests you.

Last updated on