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: eeb4e522b5d2
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf2e613dc662
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Apr 24, 2020

  1. Copy the full SHA
    ee5cba2 View commit details
  2. Merge pull request #85970 from NixOS/revert-85892-ibus-db

    Revert "ibus: fix dconf db installation"
    worldofpeace authored Apr 24, 2020
    Copy the full SHA
    cf2e613 View commit details
Showing with 21 additions and 42 deletions.
  1. +1 −1 nixos/modules/i18n/input-method/ibus.nix
  2. +10 −25 nixos/modules/programs/dconf.nix
  3. +9 −5 nixos/tests/installed-tests/ibus.nix
  4. +1 −11 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.packages = [ ibusPackage ];
programs.dconf.profiles.ibus = "${ibusPackage}/etc/dconf/profile/ibus";

services.dbus.packages = [
ibusAutostart
35 changes: 10 additions & 25 deletions nixos/modules/programs/dconf.nix
Original file line number Diff line number Diff line change
@@ -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 ];

14 changes: 9 additions & 5 deletions nixos/tests/installed-tests/ibus.nix
Original file line number Diff line number Diff line change
@@ -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;
}
12 changes: 1 addition & 11 deletions pkgs/tools/inputmethods/ibus/default.nix
Original file line number Diff line number Diff line change
@@ -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 = [