nixos/modules/system/gui.nix

38 lines
1.4 KiB
Nix
Raw Normal View History

2023-09-02 21:03:23 +08:00
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; };
2023-11-12 20:14:33 +08:00
autoStart = mkOption { type = types.bool; default = inputs.config.nixos.system.gui.preferred; };
2023-09-02 21:03:23 +08:00
};
config =
let
inherit (builtins) map;
inherit (inputs.lib) mkIf;
inherit (inputs.config.nixos.system) gui;
in mkIf gui.enable
2023-09-02 21:03:23 +08:00
{
services =
{
2024-05-25 19:27:14 +08:00
displayManager =
{ sddm = { enable = true; wayland.enable = true; theme = "breeze"; }; defaultSession = "plasma"; };
2024-05-25 22:41:59 +08:00
desktopManager.plasma6 = { enable = true; enableQt5Integration = false; };
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 ];
};
2024-05-25 20:20:41 +08:00
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" ];
};
2024-05-25 20:31:49 +08:00
programs = { dconf.enable = true; };
2023-09-02 21:03:23 +08:00
};
}