typioca: 2.7.0 -> 2.8.0
[NixPkgs.git] / nixos / modules / programs / xwayland.nix
blob8d13e4c22b5b087f9665ea0971e56e086aeaad06
1 { config, lib, pkgs, ... }:
3 with lib;
5 let
6   cfg = config.programs.xwayland;
8 in
11   options.programs.xwayland = {
13     enable = mkEnableOption (lib.mdDoc "Xwayland (an X server for interfacing X11 apps with the Wayland protocol)");
15     defaultFontPath = mkOption {
16       type = types.str;
17       default = optionalString config.fonts.fontDir.enable
18         "/run/current-system/sw/share/X11/fonts";
19       defaultText = literalExpression ''
20         optionalString config.fonts.fontDir.enable "/run/current-system/sw/share/X11/fonts"
21       '';
22       description = lib.mdDoc ''
23         Default font path. Setting this option causes Xwayland to be rebuilt.
24       '';
25     };
27     package = mkOption {
28       type = types.path;
29       default = pkgs.xwayland.override (oldArgs: {
30         inherit (cfg) defaultFontPath;
31       });
32       defaultText = literalExpression ''
33         pkgs.xwayland.override (oldArgs: {
34           inherit (config.programs.xwayland) defaultFontPath;
35         })
36       '';
37       description = lib.mdDoc "The Xwayland package to use.";
38     };
40   };
42   config = mkIf cfg.enable {
44     # Needed by some applications for fonts and default settings
45     environment.pathsToLink = [ "/share/X11" ];
47     environment.systemPackages = [ cfg.package ];
49   };