summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2020-04-24 18:22:59 -0400
committerGitHub <noreply@github.com>2020-04-24 18:22:59 -0400
commitee5cba24c31896b6aeb0af4e21b93b878e54f747 (patch)
tree76fe6763116779df2a530a6b901d41d5f32c60ce
parenteeb4e522b5d25408faab02c79a34ead8228531c9 (diff)
downloadnixpkgs-ee5cba24c31896b6aeb0af4e21b93b878e54f747.tar
nixpkgs-ee5cba24c31896b6aeb0af4e21b93b878e54f747.tar.gz
nixpkgs-ee5cba24c31896b6aeb0af4e21b93b878e54f747.tar.bz2
nixpkgs-ee5cba24c31896b6aeb0af4e21b93b878e54f747.tar.lz
nixpkgs-ee5cba24c31896b6aeb0af4e21b93b878e54f747.tar.xz
nixpkgs-ee5cba24c31896b6aeb0af4e21b93b878e54f747.tar.zst
nixpkgs-ee5cba24c31896b6aeb0af4e21b93b878e54f747.zip
Revert "ibus: fix dconf db installation"
-rw-r--r--nixos/modules/i18n/input-method/ibus.nix2
-rw-r--r--nixos/modules/programs/dconf.nix35
-rw-r--r--nixos/tests/installed-tests/ibus.nix14
-rw-r--r--pkgs/tools/inputmethods/ibus/default.nix12
4 files changed, 21 insertions, 42 deletions
diff --git a/nixos/modules/i18n/input-method/ibus.nix b/nixos/modules/i18n/input-method/ibus.nix
index cf24ecf5863..b4746b21b65 100644
--- a/nixos/modules/i18n/input-method/ibus.nix
+++ b/nixos/modules/i18n/input-method/ibus.nix
@@ -64,7 +64,7 @@ in
     # Without dconf enabled it is impossible to use IBus
     programs.dconf.enable = true;
 
-    programs.dconf.packages = [ ibusPackage ];
+    programs.dconf.profiles.ibus = "${ibusPackage}/etc/dconf/profile/ibus";
 
     services.dbus.packages = [
       ibusAutostart
diff --git a/nixos/modules/programs/dconf.nix b/nixos/modules/programs/dconf.nix
index 30fbd72a9ab..6702e8efd1c 100644
--- a/nixos/modules/programs/dconf.nix
+++ b/nixos/modules/programs/dconf.nix
@@ -4,24 +4,13 @@ with lib;
 
 let
   cfg = config.programs.dconf;
-  cfgDir = pkgs.symlinkJoin {
-    name = "dconf-system-config";
-    paths = map (x: "${x}/etc/dconf") cfg.packages;
-    postBuild = ''
-      mkdir -p $out/profile
-      mkdir -p $out/db
-    '' + (
-      concatStringsSep "\n" (
-        mapAttrsToList (
-          name: path: ''
-            ln -s ${path} $out/profile/${name}
-          ''
-        ) cfg.profiles
-      )
-    ) + ''
-      ${pkgs.dconf}/bin/dconf update $out/db
-    '';
-  };
+
+  mkDconfProfile = name: path:
+    {
+      name = "dconf/profile/${name}";
+      value.source = path; 
+    };
+
 in
 {
   ###### interface
@@ -33,22 +22,18 @@ in
       profiles = mkOption {
         type = types.attrsOf types.path;
         default = {};
-        description = "Set of dconf profile files, installed at <filename>/etc/dconf/profiles/<replaceable>name</replaceable></filename>.";
+        description = "Set of dconf profile files.";
         internal = true;
       };
 
-      packages = mkOption {
-        type = types.listOf types.package;
-        default = [];
-        description = "A list of packages which provide dconf profiles and databases in <filename>/etc/dconf</filename>.";
-      };
     };
   };
 
   ###### implementation
 
   config = mkIf (cfg.profiles != {} || cfg.enable) {
-    environment.etc.dconf.source = mkIf (cfg.profiles != {} || cfg.packages != []) cfgDir;
+    environment.etc = optionalAttrs (cfg.profiles != {})
+      (mapAttrs' mkDconfProfile cfg.profiles);
 
     services.dbus.packages = [ pkgs.dconf ];
 
diff --git a/nixos/tests/installed-tests/ibus.nix b/nixos/tests/installed-tests/ibus.nix
index a4bc2a7d7de..af54b612b50 100644
--- a/nixos/tests/installed-tests/ibus.nix
+++ b/nixos/tests/installed-tests/ibus.nix
@@ -5,12 +5,16 @@ makeInstalledTest {
 
   testConfig = {
     i18n.inputMethod.enabled = "ibus";
-    systemd.user.services.ibus-daemon = {
-      serviceConfig.ExecStart = "${pkgs.ibus}/bin/ibus-daemon --xim --verbose";
-      wantedBy = [ "graphical-session.target" ];
-      partOf = [ "graphical-session.target" ];
-    };
   };
 
+  preTestScript = ''
+    # ibus has ibus-desktop-testing-runner but it tries to manage desktop session so we just spawn ibus-daemon ourselves
+    machine.succeed("ibus-daemon --daemonize --verbose")
+  '';
+
   withX11 = true;
+
+  # TODO: ibus-daemon is currently crashing or something
+  # maybe make ibus systemd service that auto-restarts?
+  meta.broken = true;
 }
diff --git a/pkgs/tools/inputmethods/ibus/default.nix b/pkgs/tools/inputmethods/ibus/default.nix
index 238e133495c..644fd5eef3b 100644
--- a/pkgs/tools/inputmethods/ibus/default.nix
+++ b/pkgs/tools/inputmethods/ibus/default.nix
@@ -16,7 +16,6 @@
 , gtk2
 , gtk3
 , gtk-doc
-, runCommand
 , isocodes
 , cldr-emoji-annotation
 , unicode-character-database
@@ -48,14 +47,6 @@ let
       makeWrapper ${glib.dev}/bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH
     '';
   };
-  # make-dconf-override-db.sh needs to execute dbus-launch in the sandbox,
-  # it will fail to read /etc/dbus-1/session.conf unless we add this flag
-  dbus-launch = runCommand "sandbox-dbus-launch" {
-    nativeBuildInputs = [ makeWrapper ];
-  } ''
-      makeWrapper ${dbus}/bin/dbus-launch $out/bin/dbus-launch \
-        --add-flags --config-file=${dbus.daemon}/share/dbus-1/session.conf
-  '';
 in
 
 stdenv.mkDerivation rec {
@@ -80,7 +71,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "installedTests" ];
 
   postPatch = ''
-    patchShebangs --build data/dconf/make-dconf-override-db.sh
+    echo \#!${runtimeShell} > data/dconf/make-dconf-override-db.sh
     cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make .
   '';
 
@@ -114,7 +105,6 @@ stdenv.mkDerivation rec {
     python3BuildEnv
     vala
     wrapGAppsHook
-    dbus-launch
   ];
 
   propagatedBuildInputs = [