File tree 4 files changed +21
-42
lines changed
pkgs/tools/inputmethods/ibus
4 files changed +21
-42
lines changed Original file line number Diff line number Diff line change 64
64
# Without dconf enabled it is impossible to use IBus
65
65
programs . dconf . enable = true ;
66
66
67
- programs . dconf . packages = [ ibusPackage ] ;
67
+ programs . dconf . profiles . ibus = " ${ ibusPackage } /etc/dconf/profile/ibus" ;
68
68
69
69
services . dbus . packages = [
70
70
ibusAutostart
Original file line number Diff line number Diff line change @@ -4,24 +4,13 @@ with lib;
4
4
5
5
let
6
6
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
+
25
14
in
26
15
{
27
16
###### interface
33
22
profiles = mkOption {
34
23
type = types . attrsOf types . path ;
35
24
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." ;
37
26
internal = true ;
38
27
} ;
39
28
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
- } ;
45
29
} ;
46
30
} ;
47
31
48
32
###### implementation
49
33
50
34
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 ) ;
52
37
53
38
services . dbus . packages = [ pkgs . dconf ] ;
54
39
Original file line number Diff line number Diff line change @@ -5,12 +5,16 @@ makeInstalledTest {
5
5
6
6
testConfig = {
7
7
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
- } ;
13
8
} ;
14
9
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
+
15
15
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 ;
16
20
}
Original file line number Diff line number Diff line change 16
16
, gtk2
17
17
, gtk3
18
18
, gtk-doc
19
- , runCommand
20
19
, isocodes
21
20
, cldr-emoji-annotation
22
21
, unicode-character-database
48
47
makeWrapper ${ glib . dev } /bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH
49
48
'' ;
50
49
} ;
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
- '' ;
59
50
in
60
51
61
52
stdenv . mkDerivation rec {
@@ -80,7 +71,7 @@ stdenv.mkDerivation rec {
80
71
outputs = [ "out" "dev" "installedTests" ] ;
81
72
82
73
postPatch = ''
83
- patchShebangs --build data/dconf/make-dconf-override-db.sh
74
+ echo \#! ${ runtimeShell } > data/dconf/make-dconf-override-db.sh
84
75
cp ${ buildPackages . gtk-doc } /share/gtk-doc/data/gtk-doc.make .
85
76
'' ;
86
77
@@ -114,7 +105,6 @@ stdenv.mkDerivation rec {
114
105
python3BuildEnv
115
106
vala
116
107
wrapGAppsHook
117
- dbus-launch
118
108
] ;
119
109
120
110
propagatedBuildInputs = [
You can’t perform that action at this time.
0 commit comments