Nix: add XWayland info

This commit is contained in:
Mihai Fufezan 2022-08-29 19:32:20 +03:00
parent 5fb12d1089
commit 041af5f1de
No known key found for this signature in database
GPG key ID: 5899325F2F120900

View file

@ -1,9 +1,11 @@
## Table of contents ## Table of contents
{{< toc format=html >}} {{< toc format=html >}}
**NOTE:** Hyprland is NOT supported on NixOS stable. It may (not) compile or {{< hint type=warning >}}
Hyprland is NOT supported on NixOS stable. It may (not) compile or
work as intended. Please use the work as intended. Please use the
[flake](https://github.com/hyprwm/Hyprland/blob/main/flake.nix). [flake](https://github.com/hyprwm/Hyprland/blob/main/flake.nix).
{{< /hint >}}
## Install and configure Hyprland on NixOS ## Install and configure Hyprland on NixOS
@ -129,6 +131,60 @@ Check the
[nix profile](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-profile.html) [nix profile](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-profile.html)
command documentation for other upgrade options. command documentation for other upgrade options.
## XWayland
XWayland is enabled by default in the Nix package. You can disable it either
in the package itself, or through the Home Manager module.
#### Package
```nix
(inputs.hyprland.packages.${pkgs.default}.default.override {
enableXWayland = false;
})
```
#### HM module
```nix
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = false;
}
```
### HiDPI
By default, the Nix package includes a patched wlroots that can render HiDPI
XWayland windows.
In order to enable the functionality, you have to add:
```toml
exec-once=xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
```
This will make XWL programs look as if they were unscaled. To fix this, you
have to export different environment variables to make the specific toolkits
render at the proper scaling. For example
```sh
export GDK_SCALE=2
export XCURSOR_SIZE=32
```
{{< hint >}}
The GDK_SCALE variable won't conflict with wayland-native GTK programs.
{{< /hint >}}
Usually, there's no reason to disable this functionality, as it won't affect
people who don't have HiDPI screens.
If you *do* insist on disabling it though (e.g. for adding your own patches
to wlroots), you can do so by either using the `hyprland-no-hidpi` package,
or by passing the `hidpiXWayland = false;` flag, the same way as
[disabling XWayland](#package)
## Cachix ## Cachix
A [Hyprland Cachix](https://app.cachix.org/cache/hyprland) exists to cache the A [Hyprland Cachix](https://app.cachix.org/cache/hyprland) exists to cache the