mirror of
https://github.com/CHN-beta/nixos.git
synced 2024-10-23 05:39:05 +08:00
38 lines
1.3 KiB
Nix
38 lines
1.3 KiB
Nix
inputs:
|
|
{
|
|
options.nixos.system.gui = let inherit (inputs.lib) mkOption types; in
|
|
{
|
|
enable = mkOption { type = types.bool; default = false; };
|
|
preferred = mkOption { type = types.bool; default = inputs.config.nixos.system.gui.enable; };
|
|
autoStart = mkOption { type = types.bool; default = inputs.config.nixos.system.gui.preferred; };
|
|
};
|
|
config =
|
|
let
|
|
inherit (builtins) map;
|
|
inherit (inputs.lib) mkIf;
|
|
inherit (inputs.config.nixos.system) gui;
|
|
in mkIf gui.enable
|
|
{
|
|
services =
|
|
{
|
|
displayManager =
|
|
{ sddm = { enable = true; wayland.enable = true; theme = "breeze"; }; defaultSession = "plasma"; };
|
|
desktopManager.plasma6.enable = true;
|
|
xserver.enable = true;
|
|
};
|
|
systemd.services.display-manager.enable = gui.autoStart;
|
|
environment =
|
|
{
|
|
sessionVariables."GTK_USE_PORTAL" = "1";
|
|
plasma6.excludePackages = inputs.lib.mkIf (!gui.preferred) [ inputs.pkgs.kdePackages.plasma-nm ];
|
|
};
|
|
xdg.portal.extraPortals = map (p: inputs.pkgs."xdg-desktop-portal-${p}") [ "gtk" "wlr" ];
|
|
i18n.inputMethod =
|
|
{
|
|
enabled = "fcitx5";
|
|
fcitx5.addons = map (p: inputs.pkgs."fcitx5-${p}") [ "rime" "chinese-addons" "mozc" "nord" "material-color" ];
|
|
};
|
|
programs = { dconf.enable = true; };
|
|
};
|
|
}
|