2020-10-07 09:15:18 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.xwayland;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options.programs.xwayland = {
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
enable = lib.mkEnableOption "Xwayland (an X server for interfacing X11 apps with the Wayland protocol)";
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
defaultFontPath = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
|
|
|
default = lib.optionalString config.fonts.fontDir.enable
|
2020-10-07 09:15:18 +00:00
|
|
|
"/run/current-system/sw/share/X11/fonts";
|
2024-05-15 15:35:15 +00:00
|
|
|
defaultText = lib.literalExpression ''
|
2021-10-06 13:57:05 +00:00
|
|
|
optionalString config.fonts.fontDir.enable "/run/current-system/sw/share/X11/fonts"
|
2021-07-16 19:40:57 +00:00
|
|
|
'';
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2020-10-07 09:15:18 +00:00
|
|
|
Default font path. Setting this option causes Xwayland to be rebuilt.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
package = lib.mkOption {
|
|
|
|
type = lib.types.path;
|
2021-07-16 19:40:57 +00:00
|
|
|
default = pkgs.xwayland.override (oldArgs: {
|
|
|
|
inherit (cfg) defaultFontPath;
|
|
|
|
});
|
2024-05-15 15:35:15 +00:00
|
|
|
defaultText = lib.literalExpression ''
|
2021-07-16 19:40:57 +00:00
|
|
|
pkgs.xwayland.override (oldArgs: {
|
|
|
|
inherit (config.programs.xwayland) defaultFontPath;
|
2021-10-06 13:57:05 +00:00
|
|
|
})
|
2021-07-16 19:40:57 +00:00
|
|
|
'';
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "The Xwayland package to use.";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
# Needed by some applications for fonts and default settings
|
|
|
|
environment.pathsToLink = [ "/share/X11" ];
|
|
|
|
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|