about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorJosé Romildo <malaquias@gmail.com>2022-07-10 12:28:51 -0300
committerJosé Romildo <malaquias@gmail.com>2022-07-12 17:17:39 -0300
commit7e30ebb2c2b90dc866643c6409e1424f7e651baa (patch)
treeefef7f84c1f48795d6dc3d6ed5971b2a7958809c /nixos/modules
parent3fd82bba7f3a80d106136f34fe1325db1a7ebcf1 (diff)
nixos/lxqt: add a module for the lxqt portal
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/config/xdg/portals/lxqt.nix49
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/x11/desktop-managers/lxqt.nix3
3 files changed, 51 insertions, 2 deletions
diff --git a/nixos/modules/config/xdg/portals/lxqt.nix b/nixos/modules/config/xdg/portals/lxqt.nix
new file mode 100644
index 0000000000000..e85e2cc326933
--- /dev/null
+++ b/nixos/modules/config/xdg/portals/lxqt.nix
@@ -0,0 +1,49 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let
+  cfg = config.xdg.portal.lxqt;
+
+in
+{
+  meta = {
+    maintainers = teams.lxqt.members;
+  };
+
+  options.xdg.portal.lxqt = {
+    enable = mkEnableOption ''
+      the desktop portal for the LXQt desktop environment.
+
+      This will add the <package>lxqt.xdg-desktop-portal-lxqt</package>
+      package (with the extra Qt styles) into the
+      <option>xdg.portal.extraPortals</option> option
+    '';
+
+    styles = mkOption {
+      type = types.listOf types.package;
+      default = [];
+      example = literalExpression ''[
+        pkgs.libsForQt5.qtstyleplugin-kvantum
+        pkgs.breeze-qt5
+        pkgs.qtcurve
+      ];
+      '';
+      description = ''
+        Extra Qt styles that will be available to the
+        <package>lxqt.xdg-desktop-portal-lxqt</package>.
+      '';
+    };
+  };
+
+  config = mkIf cfg.enable {
+    xdg.portal = {
+      enable = true;
+      extraPortals = [
+        (pkgs.lxqt.xdg-desktop-portal-lxqt.override { extraQtStyles = cfg.styles; })
+      ];
+    };
+
+    environment.systemPackages = cfg.styles;
+  };
+}
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 034d6ba1f5826..09f1aa5baaa36 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -10,6 +10,7 @@
   ./config/xdg/mime.nix
   ./config/xdg/portal.nix
   ./config/xdg/portals/wlr.nix
+  ./config/xdg/portals/lxqt.nix
   ./config/appstream.nix
   ./config/console.nix
   ./config/xdg/sounds.nix
diff --git a/nixos/modules/services/x11/desktop-managers/lxqt.nix b/nixos/modules/services/x11/desktop-managers/lxqt.nix
index 46f35f11b4a59..2aa9e5ab331de 100644
--- a/nixos/modules/services/x11/desktop-managers/lxqt.nix
+++ b/nixos/modules/services/x11/desktop-managers/lxqt.nix
@@ -69,8 +69,7 @@ in
 
     services.xserver.libinput.enable = mkDefault true;
 
-    xdg.portal.enable = true;
-    xdg.portal.extraPortals = [ pkgs.lxqt.xdg-desktop-portal-lxqt ];
+    xdg.portal.lxqt.enable = true;
   };
 
 }