1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.programs.xwayland;
7
8in
9
10{
11 options.programs.xwayland = {
12
13 enable = mkEnableOption ''
14 Xwayland X server allows running X programs on a Wayland compositor.
15 '';
16
17 defaultFontPath = mkOption {
18 type = types.str;
19 default = optionalString config.fonts.fontDir.enable
20 "/run/current-system/sw/share/X11/fonts";
21 description = ''
22 Default font path. Setting this option causes Xwayland to be rebuilt.
23 '';
24 };
25
26 package = mkOption {
27 type = types.path;
28 description = "The Xwayland package";
29 };
30
31 };
32
33 config = mkIf cfg.enable {
34
35 # Needed by some applications for fonts and default settings
36 environment.pathsToLink = [ "/share/X11" ];
37
38 environment.systemPackages = [ cfg.package ];
39
40 programs.xwayland.package = pkgs.xwayland.override (oldArgs: {
41 inherit (cfg) defaultFontPath;
42 });
43
44 };
45}