nixos/xwayland: Correctly set the default package

This will fix #129922 and also improve the descriptions and default
texts.
This commit is contained in:
Michael Weiss 2021-07-15 11:29:15 +02:00
parent 93460e0451
commit e22bd59820
No known key found for this signature in database
GPG key ID: 5BE487C4D4771D83

View file

@ -10,14 +10,16 @@ in
{
options.programs.xwayland = {
enable = mkEnableOption ''
Xwayland X server allows running X programs on a Wayland compositor.
'';
enable = mkEnableOption "Xwayland (an X server for interfacing X11 apps with the Wayland protocol)";
defaultFontPath = mkOption {
type = types.str;
default = optionalString config.fonts.fontDir.enable
"/run/current-system/sw/share/X11/fonts";
defaultText = literalExample ''
optionalString config.fonts.fontDir.enable
"/run/current-system/sw/share/X11/fonts";
'';
description = ''
Default font path. Setting this option causes Xwayland to be rebuilt.
'';
@ -25,7 +27,15 @@ in
package = mkOption {
type = types.path;
description = "The Xwayland package";
default = pkgs.xwayland.override (oldArgs: {
inherit (cfg) defaultFontPath;
});
defaultText = literalExample ''
pkgs.xwayland.override (oldArgs: {
inherit (config.programs.xwayland) defaultFontPath;
});
'';
description = "The Xwayland package to use.";
};
};
@ -37,9 +47,5 @@ in
environment.systemPackages = [ cfg.package ];
programs.xwayland.package = pkgs.xwayland.override (oldArgs: {
inherit (cfg) defaultFontPath;
});
};
}