2022-12-18 14:20:19 +01:00
The NixOS module enables critical components needed to run Hyprland properly,
such as: polkit,
[xdg-desktop-portal-hyprland ](https://github.com/hyprwm/xdg-desktop-portal-hyprland ),
graphics drivers, fonts, dconf, xwayland, and adding a proper Desktop Entry to
your Display Manager.
Make sure to check out the options of the
2023-04-09 14:02:54 +02:00
[NixOS module ](https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=hyprland ).
2022-12-18 14:20:19 +01:00
2023-09-04 17:46:31 +02:00
{{< hint title = Note > }}
- *(Required) NixOS Module*: enables critical components needed to run Hyprland properly
- *(Optional) Home-manager module*: lets you declaratively configure Hyprland
{{< / hint > }}
2023-07-17 18:14:43 +02:00
{{< tabs " uniqueid " > }}
{{< tab " Nixpkgs " > }}
2022-12-18 14:20:19 +01:00
2023-04-09 14:02:54 +02:00
```nix
# configuration.nix
{pkgs, ...}: {
programs.hyprland.enable = true;
}
```
2023-07-17 18:14:43 +02:00
This will use the Hyprland version that Nixpkgs has.
{{< / tab > }}
{{< tab " Flake package " > }}
{{< hint > }}
Please enable [Cachix ](../Cachix ) before using the flake package, so you don't
have to compile Hyprland yourself.
{{< / hint > }}
2023-04-09 14:02:54 +02:00
2023-07-17 18:14:43 +02:00
In case you want to use the development version of Hyprland, you can add it
like this:
2023-04-09 14:02:54 +02:00
```nix
# flake.nix
{
inputs.hyprland.url = "github:hyprwm/Hyprland";
# ...
outputs = {nixpkgs, ...} @ inputs: {
nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem {
2023-07-17 18:14:43 +02:00
specialArgs = { inherit inputs; }; # this is the important part
modules = [
./configuration.nix
];
2023-04-09 14:02:54 +02:00
};
}
}
# configuration.nix
{inputs, pkgs, ...}: {
2023-07-17 18:14:43 +02:00
programs.hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
2022-12-18 14:20:19 +01:00
};
2022-12-28 16:31:43 +01:00
}
2022-12-18 14:20:19 +01:00
```
2023-07-17 18:14:43 +02:00
Don't forget to change the `HOSTNAME` to your actual hostname!
2022-12-18 14:20:19 +01:00
2023-07-17 18:14:43 +02:00
{{< / tab > }}
2022-12-18 14:20:19 +01:00
2023-07-17 18:14:43 +02:00
{{< tab " Flake package , Nix stable " > }}
2022-12-18 14:20:19 +01:00
{{< hint > }}
2023-07-17 18:14:43 +02:00
Please enable [Cachix ](../Cachix ) before using the flake package, so you don't
have to compile Hyprland yourself.
2022-12-18 14:20:19 +01:00
{{< / hint > }}
```nix
# configuration.nix
2023-02-14 14:30:40 +01:00
{pkgs, ...}: let
2022-12-18 14:20:19 +01:00
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
2023-02-14 14:30:40 +01:00
2023-07-17 18:14:43 +02:00
hyprland-flake = (import flake-compat {
2022-12-18 14:20:19 +01:00
src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz";
}).defaultNix;
in {
programs.hyprland = {
enable = true;
2023-07-17 18:14:43 +02:00
package = hyprland-flake.packages.${pkgs.system}.hyprland;
2022-12-18 14:20:19 +01:00
};
}
```
2023-07-17 18:14:43 +02:00
{{< / tab > }}
{{< / tabs > }}
2023-10-17 08:04:44 +02:00
## Fixing problems with themes
2023-11-12 16:50:39 +01:00
If your themes for mouse cursor, icons or windows don't load correctly, see the relevant section in [Hyprland on Home Manager ](../Hyprland-on-Home-Manager ).