at 23.11-pre 1.3 kB view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 cfg = config.programs.xwayland; 7 8in 9 10{ 11 options.programs.xwayland = { 12 13 enable = mkEnableOption (lib.mdDoc "Xwayland (an X server for interfacing X11 apps with the Wayland protocol)"); 14 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 }; 26 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 }; 39 40 }; 41 42 config = mkIf cfg.enable { 43 44 # Needed by some applications for fonts and default settings 45 environment.pathsToLink = [ "/share/X11" ]; 46 47 environment.systemPackages = [ cfg.package ]; 48 49 }; 50}