summary refs log tree commit diff
path: root/nixos/modules/config/qt-plugin-env.nix
diff options
context:
space:
mode:
authortaku0 <mxxouy6x3m_github@tatapa.org>2014-07-13 15:46:34 +0900
committertaku0 <mxxouy6x3m_github@tatapa.org>2014-07-14 21:33:05 +0900
commita0c91d66f1d63192a8145e5d0314eaa701542604 (patch)
tree1706306045ac384f7a6f257b5369cfa9180875d9 /nixos/modules/config/qt-plugin-env.nix
parentd2e731e111d6be3be7c25d237214e862fab4ca5d (diff)
downloadnixpkgs-a0c91d66f1d63192a8145e5d0314eaa701542604.tar
nixpkgs-a0c91d66f1d63192a8145e5d0314eaa701542604.tar.gz
nixpkgs-a0c91d66f1d63192a8145e5d0314eaa701542604.tar.bz2
nixpkgs-a0c91d66f1d63192a8145e5d0314eaa701542604.tar.lz
nixpkgs-a0c91d66f1d63192a8145e5d0314eaa701542604.tar.xz
nixpkgs-a0c91d66f1d63192a8145e5d0314eaa701542604.tar.zst
nixpkgs-a0c91d66f1d63192a8145e5d0314eaa701542604.zip
uim, gtk-exe-env, qt-plugin-env: Add input method modules for GTK+ and Qt
Diffstat (limited to 'nixos/modules/config/qt-plugin-env.nix')
-rw-r--r--nixos/modules/config/qt-plugin-env.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixos/modules/config/qt-plugin-env.nix b/nixos/modules/config/qt-plugin-env.nix
new file mode 100644
index 00000000000..c5986560416
--- /dev/null
+++ b/nixos/modules/config/qt-plugin-env.nix
@@ -0,0 +1,37 @@
+{ config, pkgs, lib, ... }:
+
+{
+  imports = [
+  ];
+
+  options = {
+    qtPlugins = lib.mkOption {
+      type = lib.types.listOf lib.types.path;
+      default = [];
+      description = ''
+        Plugin packages for Qt such as input methods.
+      '';
+    };
+  };
+
+  config = {
+    environment.variables = if builtins.length config.qtPlugins > 0
+      then
+        let
+          paths = [ pkgs.qt48 ] ++ config.qtPlugins;
+          env = pkgs.buildEnv {
+            name = "qt-plugin-env";
+
+            inherit paths;
+
+            postBuild = lib.concatStringsSep "\n"
+              (map (d: d.qtPluginEnvPostBuild or "") paths);
+
+            ignoreCollisions = true;
+          };
+        in {
+          QT_PLUGIN_PATH = [ (builtins.toString env) ];
+        }
+      else {};
+  };
+}