From a0c91d66f1d63192a8145e5d0314eaa701542604 Mon Sep 17 00:00:00 2001 From: taku0 Date: Sun, 13 Jul 2014 15:46:34 +0900 Subject: uim, gtk-exe-env, qt-plugin-env: Add input method modules for GTK+ and Qt --- nixos/modules/config/qt-plugin-env.nix | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 nixos/modules/config/qt-plugin-env.nix (limited to 'nixos/modules/config/qt-plugin-env.nix') 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 {}; + }; +} -- cgit 1.4.1