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:
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 flakesOnce 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#hyprlandReplace #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.desktopso 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.