2022-12-18 14:20:19 +01:00
|
|
|
You can override the package through `.override` or `.overrideAttrs`. This is
|
2023-07-17 18:14:43 +02:00
|
|
|
easily achievable through [NixOS](../Hyprland-on-NixOS) or [Home Manager](../Hyprland-on-Home-Manager).
|
2022-12-18 14:20:19 +01:00
|
|
|
|
|
|
|
## Package options
|
|
|
|
|
|
|
|
These are the default options that the Hyprland package is built with. These
|
|
|
|
can be changed by setting the appropriate option to `true`/`false`.
|
|
|
|
|
|
|
|
### Package
|
|
|
|
|
|
|
|
```nix
|
2023-07-17 18:14:43 +02:00
|
|
|
(pkgs.hyprland.override { # or inputs.hyprland.packages.${pkgs.system}.hyprland
|
2022-12-18 14:20:19 +01:00
|
|
|
enableXWayland = true;
|
2023-06-13 13:14:21 +02:00
|
|
|
hidpiXWayland = false;
|
2022-12-18 14:20:19 +01:00
|
|
|
nvidiaPatches = false;
|
|
|
|
})
|
|
|
|
```
|
|
|
|
|
|
|
|
### NixOS & HM modules
|
|
|
|
|
|
|
|
```nix
|
|
|
|
programs.hyprland = { # or wayland.windowManager.hyprland
|
|
|
|
enable = true;
|
|
|
|
xwayland = {
|
|
|
|
enable = true;
|
2023-06-13 13:14:21 +02:00
|
|
|
hidpi = false;
|
2022-12-18 14:20:19 +01:00
|
|
|
};
|
|
|
|
nvidiaPatches = false;
|
2022-12-28 16:31:43 +01:00
|
|
|
};
|
2022-12-18 14:20:19 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Options descriptions
|
|
|
|
|
|
|
|
### XWayland
|
|
|
|
|
|
|
|
XWayland is enabled by default in the Nix package. You can disable it either
|
|
|
|
in the package itself, or through the module options.
|
|
|
|
|
|
|
|
### XWayland HiDPI
|
|
|
|
|
2023-06-13 13:14:21 +02:00
|
|
|
The `hyprland-hidpi` Nix package includes a patched wlroots that can render
|
|
|
|
HiDPI XWayland windows.
|
2022-12-18 14:20:19 +01:00
|
|
|
|
2023-06-13 13:14:21 +02:00
|
|
|
In order to enable HiDPI when using the NixOS or Home Manager modules, you can
|
|
|
|
set `programs.hyprland.xwayland.hidpi = true`, or
|
|
|
|
`wayland.windowManager.hyprland.xwayland.hidpi = true`, respectively.
|
|
|
|
|
|
|
|
Now that the required package to achieve HiDPI is installed, an XWayland
|
|
|
|
instruction is needed to set the scale:
|
2022-12-18 14:20:19 +01:00
|
|
|
|
|
|
|
```toml
|
2023-02-14 14:30:40 +01:00
|
|
|
exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
|
2022-12-18 14:20:19 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
This will make XWayland programs look as if they were unscaled. To fix this, you
|
2023-03-05 15:53:44 +01:00
|
|
|
have to set different environment variables to make the specific toolkits
|
|
|
|
render at the proper scaling. For example, add this to your `hyprland.conf`:
|
2022-12-18 14:20:19 +01:00
|
|
|
|
2023-03-05 15:53:44 +01:00
|
|
|
```ini
|
|
|
|
env = GDK_SCALE,2
|
|
|
|
env = XCURSOR_SIZE,48
|
2022-12-18 14:20:19 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
{{< hint >}}
|
2023-07-17 18:14:43 +02:00
|
|
|
The `GDK_SCALE` environment variable won't conflict with Wayland-native GTK programs.
|
2022-12-18 14:20:19 +01:00
|
|
|
{{< /hint >}}
|
|
|
|
|
|
|
|
### Nvidia Patches
|
|
|
|
|
|
|
|
Nvidia is notorious for not working by default with wlroots. That's why we
|
|
|
|
patch wlroots.
|
|
|
|
|
2023-06-13 13:14:21 +02:00
|
|
|
In the NixOS and Home Manager modules, you can enable the Nvidia patches using
|
|
|
|
`programs.hyprland.nvidiaPatches` and `wayland.windowManager.hyprland.nvidiaPatches`,
|
|
|
|
respectively.
|
|
|
|
|
2022-12-18 14:20:19 +01:00
|
|
|
## Using Nix repl
|
|
|
|
|
|
|
|
If you're using Nix (and not NixOS or Home Manager) and you want to override,
|
|
|
|
you can do it like this
|
|
|
|
|
2023-04-23 22:20:55 +02:00
|
|
|
```console
|
2022-12-18 14:20:19 +01:00
|
|
|
$ nix repl
|
|
|
|
nix-repl> :lf "github:hyprwm/Hyprland"
|
|
|
|
nix-repl> :bl outputs.packages.x86_64-linux.hyprland.override {nvidiaPatches = true;} # option = value
|
|
|
|
```
|
|
|
|
|
|
|
|
Then you can run Hyprland from the built path.
|