Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 812468890686
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 56619d6ebb7b
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Jun 2, 2020

  1. ibus: fix installation of dconf database

    Fixes this warning at ibus-daemon startup:
    
    (ibus-dconf:15691): dconf-WARNING **: 21:49:24.018: unable to open file '/etc/dconf/db/ibus': Failed to open file ?/etc/dconf/db/ibus?: open() failed: No such file or directory; expect degraded performance
    symphorien committed Jun 2, 2020
    Copy the full SHA
    3dbd629 View commit details
  2. Revert "Revert "ibus: fix dconf db installation""

    This reverts commit ee5cba2.
    symphorien committed Jun 2, 2020
    Copy the full SHA
    11d6318 View commit details

Commits on Jul 7, 2020

  1. Merge pull request #85992 from symphorien/ibus-db

    ibus: fix dconf database
    worldofpeace authored Jul 7, 2020
    Copy the full SHA
    56619d6 View commit details
Showing with 44 additions and 21 deletions.
  1. +1 −1 nixos/modules/i18n/input-method/ibus.nix
  2. +27 −10 nixos/modules/programs/dconf.nix
  3. +5 −9 nixos/tests/installed-tests/ibus.nix
  4. +11 −1 pkgs/tools/inputmethods/ibus/default.nix
2 changes: 1 addition & 1 deletion nixos/modules/i18n/input-method/ibus.nix
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ in
# Without dconf enabled it is impossible to use IBus
programs.dconf.enable = true;

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

services.dbus.packages = [
ibusAutostart
37 changes: 27 additions & 10 deletions nixos/modules/programs/dconf.nix
Original file line number Diff line number Diff line change
@@ -4,13 +4,24 @@ with lib;

let
cfg = config.programs.dconf;

mkDconfProfile = name: path:
{
name = "dconf/profile/${name}";
value.source = path;
};

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
'';
};
in
{
###### interface
@@ -22,18 +33,24 @@ in
profiles = mkOption {
type = types.attrsOf types.path;
default = {};
description = "Set of dconf profile files.";
description = "Set of dconf profile files, installed at <filename>/etc/dconf/profiles/<replaceable>name</replaceable></filename>.";
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 = optionalAttrs (cfg.profiles != {})
(mapAttrs' mkDconfProfile cfg.profiles);
environment.etc.dconf = mkIf (cfg.profiles != {} || cfg.packages != []) {
source = cfgDir;
};

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

14 changes: 5 additions & 9 deletions nixos/tests/installed-tests/ibus.nix
Original file line number Diff line number Diff line change
@@ -5,16 +5,12 @@ 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;
}
12 changes: 11 additions & 1 deletion pkgs/tools/inputmethods/ibus/default.nix
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
, gtk2
, gtk3
, gtk-doc
, runCommand
, isocodes
, cldr-emoji-annotation
, unicode-character-database
@@ -47,6 +48,14 @@ 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 {
@@ -71,7 +80,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "installedTests" ];

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

@@ -105,6 +114,7 @@ stdenv.mkDerivation rec {
python3BuildEnv
vala
wrapGAppsHook
dbus-launch
];

propagatedBuildInputs = [