1 { config, lib, pkgs, ... }:
4 cfg = config.programs.xwayland;
9 options.programs.xwayland = {
11 enable = lib.mkEnableOption "Xwayland (an X server for interfacing X11 apps with the Wayland protocol)";
13 defaultFontPath = lib.mkOption {
15 default = lib.optionalString config.fonts.fontDir.enable
16 "/run/current-system/sw/share/X11/fonts";
17 defaultText = lib.literalExpression ''
18 optionalString config.fonts.fontDir.enable "/run/current-system/sw/share/X11/fonts"
21 Default font path. Setting this option causes Xwayland to be rebuilt.
25 package = lib.mkOption {
26 type = lib.types.path;
27 default = pkgs.xwayland.override (oldArgs: {
28 inherit (cfg) defaultFontPath;
30 defaultText = lib.literalExpression ''
31 pkgs.xwayland.override (oldArgs: {
32 inherit (config.programs.xwayland) defaultFontPath;
35 description = "The Xwayland package to use.";
40 config = lib.mkIf cfg.enable {
42 # Needed by some applications for fonts and default settings
43 environment.pathsToLink = [ "/share/X11" ];
45 environment.systemPackages = [ cfg.package ];