Skip to content

Commit ee5cba2

Browse files
authoredApr 24, 2020
Revert "ibus: fix dconf db installation"
1 parent eeb4e52 commit ee5cba2

File tree

4 files changed

+21
-42
lines changed

4 files changed

+21
-42
lines changed
 

‎nixos/modules/i18n/input-method/ibus.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ in
6464
# Without dconf enabled it is impossible to use IBus
6565
programs.dconf.enable = true;
6666

67-
programs.dconf.packages = [ ibusPackage ];
67+
programs.dconf.profiles.ibus = "${ibusPackage}/etc/dconf/profile/ibus";
6868

6969
services.dbus.packages = [
7070
ibusAutostart

‎nixos/modules/programs/dconf.nix

+10-25
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,13 @@ with lib;
44

55
let
66
cfg = config.programs.dconf;
7-
cfgDir = pkgs.symlinkJoin {
8-
name = "dconf-system-config";
9-
paths = map (x: "${x}/etc/dconf") cfg.packages;
10-
postBuild = ''
11-
mkdir -p $out/profile
12-
mkdir -p $out/db
13-
'' + (
14-
concatStringsSep "\n" (
15-
mapAttrsToList (
16-
name: path: ''
17-
ln -s ${path} $out/profile/${name}
18-
''
19-
) cfg.profiles
20-
)
21-
) + ''
22-
${pkgs.dconf}/bin/dconf update $out/db
23-
'';
24-
};
7+
8+
mkDconfProfile = name: path:
9+
{
10+
name = "dconf/profile/${name}";
11+
value.source = path;
12+
};
13+
2514
in
2615
{
2716
###### interface
@@ -33,22 +22,18 @@ in
3322
profiles = mkOption {
3423
type = types.attrsOf types.path;
3524
default = {};
36-
description = "Set of dconf profile files, installed at <filename>/etc/dconf/profiles/<replaceable>name</replaceable></filename>.";
25+
description = "Set of dconf profile files.";
3726
internal = true;
3827
};
3928

40-
packages = mkOption {
41-
type = types.listOf types.package;
42-
default = [];
43-
description = "A list of packages which provide dconf profiles and databases in <filename>/etc/dconf</filename>.";
44-
};
4529
};
4630
};
4731

4832
###### implementation
4933

5034
config = mkIf (cfg.profiles != {} || cfg.enable) {
51-
environment.etc.dconf.source = mkIf (cfg.profiles != {} || cfg.packages != []) cfgDir;
35+
environment.etc = optionalAttrs (cfg.profiles != {})
36+
(mapAttrs' mkDconfProfile cfg.profiles);
5237

5338
services.dbus.packages = [ pkgs.dconf ];
5439

‎nixos/tests/installed-tests/ibus.nix

+9-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ makeInstalledTest {
55

66
testConfig = {
77
i18n.inputMethod.enabled = "ibus";
8-
systemd.user.services.ibus-daemon = {
9-
serviceConfig.ExecStart = "${pkgs.ibus}/bin/ibus-daemon --xim --verbose";
10-
wantedBy = [ "graphical-session.target" ];
11-
partOf = [ "graphical-session.target" ];
12-
};
138
};
149

10+
preTestScript = ''
11+
# ibus has ibus-desktop-testing-runner but it tries to manage desktop session so we just spawn ibus-daemon ourselves
12+
machine.succeed("ibus-daemon --daemonize --verbose")
13+
'';
14+
1515
withX11 = true;
16+
17+
# TODO: ibus-daemon is currently crashing or something
18+
# maybe make ibus systemd service that auto-restarts?
19+
meta.broken = true;
1620
}

‎pkgs/tools/inputmethods/ibus/default.nix

+1-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
, gtk2
1717
, gtk3
1818
, gtk-doc
19-
, runCommand
2019
, isocodes
2120
, cldr-emoji-annotation
2221
, unicode-character-database
@@ -48,14 +47,6 @@ let
4847
makeWrapper ${glib.dev}/bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH
4948
'';
5049
};
51-
# make-dconf-override-db.sh needs to execute dbus-launch in the sandbox,
52-
# it will fail to read /etc/dbus-1/session.conf unless we add this flag
53-
dbus-launch = runCommand "sandbox-dbus-launch" {
54-
nativeBuildInputs = [ makeWrapper ];
55-
} ''
56-
makeWrapper ${dbus}/bin/dbus-launch $out/bin/dbus-launch \
57-
--add-flags --config-file=${dbus.daemon}/share/dbus-1/session.conf
58-
'';
5950
in
6051

6152
stdenv.mkDerivation rec {
@@ -80,7 +71,7 @@ stdenv.mkDerivation rec {
8071
outputs = [ "out" "dev" "installedTests" ];
8172

8273
postPatch = ''
83-
patchShebangs --build data/dconf/make-dconf-override-db.sh
74+
echo \#!${runtimeShell} > data/dconf/make-dconf-override-db.sh
8475
cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make .
8576
'';
8677

@@ -114,7 +105,6 @@ stdenv.mkDerivation rec {
114105
python3BuildEnv
115106
vala
116107
wrapGAppsHook
117-
dbus-launch
118108
];
119109

120110
propagatedBuildInputs = [

0 commit comments

Comments
 (0)
Please sign in to comment.