From 6258eec747e21e113576f4e25087a108ca7d6c80 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Mon, 10 Mar 2025 00:24:32 +0800 Subject: [PATCH] add qtct for qt application --- home/modules/programs/niri.nix | 37 ++++++++++++++++++++++++++++++++++ nixos/modules/gui/niri.nix | 6 ++++++ 2 files changed, 43 insertions(+) diff --git a/home/modules/programs/niri.nix b/home/modules/programs/niri.nix index 7b3765a..2401c4d 100644 --- a/home/modules/programs/niri.nix +++ b/home/modules/programs/niri.nix @@ -30,6 +30,43 @@ in wl-clipboard cliphist ]; + qt = { + enable = true; + }; + xdg.portal = { + configPackages = [ pkgs.niri-unstable ]; + config = { + common = { + default = [ + "cosmic" + ]; + }; + }; + enable = true; + extraPortals = lib.mkIf ( + !pkgs.niri-unstable.cargoBuildNoDefaultFeatures + || builtins.elem "xdp-gnome-screencast" pkgs.niri-unstable.cargoBuildFeatures + ) [ pkgs.xdg-desktop-portal-gnome ]; + }; + xdg.configFile = + let + qtctConf = + '' + [Appearance] + standard_dialogs=xdgdesktopportal + '' + + lib.optionalString (config.qt.style ? name) '' + style=${config.qt.style.name} + ''; + in + { + "qt5ct/qt5ct.conf" = lib.mkForce { + text = qtctConf; + }; + "qt6ct/qt6ct.conf" = lib.mkForce { + text = qtctConf; + }; + }; youthlic.programs = { fuzzel.enable = true; wluma.enable = true; diff --git a/nixos/modules/gui/niri.nix b/nixos/modules/gui/niri.nix index c4fcdb5..8f14f77 100644 --- a/nixos/modules/gui/niri.nix +++ b/nixos/modules/gui/niri.nix @@ -9,9 +9,15 @@ let in { config = lib.mkIf (cfg.enabled == "niri") { + qt = { + enable = true; + platformTheme = "qt5ct"; + }; environment.systemPackages = with pkgs; [ bluez cosmic-files + kdePackages.qt6ct + libsForQt5.qt5ct ]; xdg.mime = { enable = true;