diff options
-rw-r--r-- | nixos/modules/config/gtk-exe-env.nix | 41 | ||||
-rw-r--r-- | nixos/modules/config/qt-plugin-env.nix | 37 | ||||
-rw-r--r-- | nixos/modules/i18n/inputMethod/fcitx.nix | 14 | ||||
-rw-r--r-- | nixos/modules/i18n/inputMethod/nabi.nix | 1 | ||||
-rw-r--r-- | nixos/modules/i18n/inputMethod/uim.nix | 2 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 3 | ||||
-rw-r--r-- | nixos/modules/programs/uim.nix | 31 | ||||
-rw-r--r-- | pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix | 14 | ||||
-rw-r--r-- | pkgs/tools/inputmethods/ibus/wrapper.nix | 13 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 5 |
10 files changed, 31 insertions, 130 deletions
diff --git a/nixos/modules/config/gtk-exe-env.nix b/nixos/modules/config/gtk-exe-env.nix deleted file mode 100644 index b565072e3a71..000000000000 --- a/nixos/modules/config/gtk-exe-env.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - imports = [ - ]; - - options = { - gtkPlugins = lib.mkOption { - type = lib.types.listOf lib.types.path; - default = []; - description = '' - Plugin packages for GTK+ such as input methods. - ''; - }; - }; - - config = { - environment.variables = if builtins.length config.gtkPlugins > 0 - then - let - paths = [ pkgs.gtk2 pkgs.gtk3 ] ++ config.gtkPlugins; - env = pkgs.buildEnv { - name = "gtk-exe-env"; - - inherit paths; - - postBuild = lib.concatStringsSep "\n" - (map (d: d.gtkExeEnvPostBuild or "") paths); - - ignoreCollisions = true; - }; - in { - GTK_EXE_PREFIX = builtins.toString env; - GTK_PATH = [ - "${env}/lib/gtk-2.0" - "${env}/lib/gtk-3.0" - ]; - } - else {}; - }; -} diff --git a/nixos/modules/config/qt-plugin-env.nix b/nixos/modules/config/qt-plugin-env.nix deleted file mode 100644 index c59865604165..000000000000 --- a/nixos/modules/config/qt-plugin-env.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ 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 {}; - }; -} diff --git a/nixos/modules/i18n/inputMethod/fcitx.nix b/nixos/modules/i18n/inputMethod/fcitx.nix index f168f4451703..8e31743504f1 100644 --- a/nixos/modules/i18n/inputMethod/fcitx.nix +++ b/nixos/modules/i18n/inputMethod/fcitx.nix @@ -18,10 +18,14 @@ in type = with types; listOf fcitxEngine; default = []; example = literalExample "with pkgs.fcitx-engines; [ mozc hangul ]"; - description = '' - Enabled Fcitx engines. - Available engines can be found by running `nix-env "<nixpkgs>" . -qaP -A fcitx-engines`. - ''; + description = + let + engines = + lib.concatStringsSep ", " + (map (name: "<literal>${name}</literal>") + (lib.attrNames pkgs.fcitx-engines)); + in + "Enabled Fcitx engines. Available engines are: ${engines}."; }; }; @@ -29,8 +33,6 @@ in config = mkIf (config.i18n.inputMethod.enabled == "fcitx") { environment.systemPackages = [ fcitxPackage ]; - gtkPlugins = [ fcitxPackage ]; - qtPlugins = [ fcitxPackage ]; environment.variables = { GTK_IM_MODULE = "fcitx"; diff --git a/nixos/modules/i18n/inputMethod/nabi.nix b/nixos/modules/i18n/inputMethod/nabi.nix index 8c3965955130..c6708365effa 100644 --- a/nixos/modules/i18n/inputMethod/nabi.nix +++ b/nixos/modules/i18n/inputMethod/nabi.nix @@ -4,7 +4,6 @@ with lib; { config = mkIf (config.i18n.inputMethod.enabled == "nabi") { environment.systemPackages = [ pkgs.nabi ]; - qtPlugins = [ pkgs.nabi ]; environment.variables = { GTK_IM_MODULE = "nabi"; diff --git a/nixos/modules/i18n/inputMethod/uim.nix b/nixos/modules/i18n/inputMethod/uim.nix index 401e1932f70c..f8a3e560656d 100644 --- a/nixos/modules/i18n/inputMethod/uim.nix +++ b/nixos/modules/i18n/inputMethod/uim.nix @@ -23,8 +23,6 @@ in config = mkIf (config.i18n.inputMethod.enabled == "uim") { environment.systemPackages = [ pkgs.uim ]; - gtkPlugins = [ pkgs.uim ]; - qtPlugins = [ pkgs.uim ]; environment.variables = { GTK_IM_MODULE = "uim"; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index a50b17068f66..ad1636e002d8 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -7,7 +7,6 @@ ./config/fonts/fonts.nix ./config/fonts/ghostscript.nix ./config/gnu.nix - ./config/gtk-exe-env.nix ./config/i18n.nix ./config/krb5.nix ./config/ldap.nix @@ -16,7 +15,6 @@ ./config/nsswitch.nix ./config/power-management.nix ./config/pulseaudio.nix - ./config/qt-plugin-env.nix ./config/shells-environment.nix ./config/swap.nix ./config/sysctl.nix @@ -79,7 +77,6 @@ ./programs/shell.nix ./programs/ssh.nix ./programs/ssmtp.nix - ./programs/uim.nix ./programs/venus.nix ./programs/wvdial.nix ./programs/xfs_quota.nix diff --git a/nixos/modules/programs/uim.nix b/nixos/modules/programs/uim.nix deleted file mode 100644 index 4bf2f9a17571..000000000000 --- a/nixos/modules/programs/uim.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, pkgs, lib, ... }: - -with lib; - -let - cfg = config.uim; -in -{ - options = { - - uim = { - enable = mkOption { - type = types.bool; - default = false; - example = true; - description = "Enable UIM input method"; - }; - }; - - }; - - config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.uim ]; - gtkPlugins = [ pkgs.uim ]; - qtPlugins = [ pkgs.uim ]; - environment.variables.GTK_IM_MODULE = "uim"; - environment.variables.QT_IM_MODULE = "uim"; - environment.variables.XMODIFIERS = "@im=uim"; - services.xserver.displayManager.sessionCommands = "uim-xim &"; - }; -} diff --git a/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix b/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix index c6c43d058982..81bfffb25464 100644 --- a/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix +++ b/pkgs/tools/inputmethods/ibus-engines/ibus-m17n/default.nix @@ -1,5 +1,7 @@ -{ stdenv, fetchFromGitHub, ibus, m17n_lib, m17n_db, automake, autoconf, - gettext, libtool, pkgconfig, python, pythonPackages }: +{ stdenv, fetchFromGitHub +, automake, autoconf, libtool, pkgconfig +, ibus, m17n_lib, m17n_db, gettext, python3, pygobject3 +}: stdenv.mkDerivation rec { name = "ibus-m17n-${version}"; @@ -12,11 +14,13 @@ stdenv.mkDerivation rec { sha256 = "1n0bvgc4jyksgvzrw5zs2pxcpxcn3gcc0j2kasbznm34fpv3frsr"; }; - buildInputs = [ - ibus m17n_lib m17n_db automake autoconf gettext - libtool pkgconfig python pythonPackages.pygobject3 + buildInputs = [ + ibus m17n_lib m17n_db gettext + python3 pygobject3 ]; + nativeBuildInputs = [ automake autoconf libtool pkgconfig ]; + preConfigure = '' autoreconf --verbose --force --install ''; diff --git a/pkgs/tools/inputmethods/ibus/wrapper.nix b/pkgs/tools/inputmethods/ibus/wrapper.nix index 3bccad1cc0c9..72fbaef6604a 100644 --- a/pkgs/tools/inputmethods/ibus/wrapper.nix +++ b/pkgs/tools/inputmethods/ibus/wrapper.nix @@ -1,11 +1,15 @@ -{ stdenv, runCommand, ibus, lndir, makeWrapper, plugins, hicolor_icon_theme }: +{ stdenv, runCommand, makeWrapper, lndir +, dconf, hicolor_icon_theme, ibus, plugins +}: let name = "ibus-with-plugins-" + (builtins.parseDrvName ibus.name).version; env = { + buildInputs = [ ibus ] ++ plugins; nativeBuildInputs = [ lndir makeWrapper ]; propagatedUserEnvPackages = [ hicolor_icon_theme ]; paths = [ ibus ] ++ plugins; + inherit (ibus) meta; }; command = '' for dir in bin etc lib libexec share; do @@ -19,7 +23,8 @@ let for prog in ibus ibus-daemon ibus-setup; do wrapProgram "$out/bin/$prog" \ - --suffix XDG_DATA_DIRS : "${hicolor_icon_theme}/share" \ + --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH:$out/lib/girepository-1.0" \ + --prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules" \ --set IBUS_COMPONENT_PATH "$out/share/ibus/component/" \ --set IBUS_DATAROOTDIR "$out/share" \ --set IBUS_LIBEXECDIR "$out/libexec" \ @@ -29,7 +34,9 @@ let --set IBUS_TABLE_DATA_DIR "$out/share" \ --set IBUS_TABLE_LIB_LOCATION "$out/libexec" \ --set IBUS_TABLE_LOCATION "$out/share/ibus-table" \ - --set IBUS_TABLE_DEBUG_LEVEL 1 + --prefix PYTHONPATH : "$PYTHONPATH" \ + --prefix XDG_DATA_DIRS : "$out/share:$GSETTINGS_SCHEMAS_PATH" \ + --suffix XDG_DATA_DIRS : "${hicolor_icon_theme}/share" done ''; in diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 08517163ebc7..ef6dc1f6f3b4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1180,7 +1180,9 @@ let inherit (python3Packages) pygobject3; }; - m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { }; + m17n = callPackage ../tools/inputmethods/ibus-engines/ibus-m17n { + inherit (python3Packages) pygobject3; + }; mozc = callPackage ../tools/inputmethods/ibus-engines/ibus-mozc { inherit (pythonPackages) gyp; @@ -1198,6 +1200,7 @@ let }; ibus-with-plugins = callPackage ../tools/inputmethods/ibus/wrapper.nix { + inherit (gnome3) dconf; plugins = [ ]; }; |