Merge pull request #130257 from primeos/nixos-xwayland

nixos/xwayland: Correctly set the default package
This commit is contained in:
Robert Hensing 2021-07-15 15:28:53 +02:00 committed by GitHub
commit 90cbe95037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;
});
};
}