mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
speechd: use socket activation
This commit is contained in:
parent
5537661d08
commit
089fa2b542
3 changed files with 18 additions and 4 deletions
|
@ -7,7 +7,6 @@
|
||||||
let
|
let
|
||||||
cfg = config.services.speechd;
|
cfg = config.services.speechd;
|
||||||
inherit (lib)
|
inherit (lib)
|
||||||
getExe
|
|
||||||
mkEnableOption
|
mkEnableOption
|
||||||
mkIf
|
mkIf
|
||||||
mkPackageOption
|
mkPackageOption
|
||||||
|
@ -21,12 +20,12 @@ in
|
||||||
package = mkPackageOption pkgs "speechd" { };
|
package = mkPackageOption pkgs "speechd" { };
|
||||||
};
|
};
|
||||||
|
|
||||||
# FIXME: speechd 0.12 (or whatever the next version is)
|
|
||||||
# will support socket activation, so switch to that once it's out.
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = [ cfg.package ];
|
systemPackages = [ cfg.package ];
|
||||||
sessionVariables.SPEECHD_CMD = getExe cfg.package;
|
|
||||||
};
|
};
|
||||||
|
systemd.packages = [ cfg.package ];
|
||||||
|
# have to set `wantedBy` since `systemd.packages` ignores `[Install]`
|
||||||
|
systemd.user.sockets.speech-dispatcher.wantedBy = [ "sockets.target" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
diff --git a/speech-dispatcher.service.in b/speech-dispatcher.service.in
|
||||||
|
index 6280f2d9..edf6024c 100644
|
||||||
|
--- a/speech-dispatcher.service.in
|
||||||
|
+++ b/speech-dispatcher.service.in
|
||||||
|
@@ -20,4 +20,4 @@ Requires=speech-dispatcher.socket
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=@bindir@/speech-dispatcher -s -t 0
|
||||||
|
-ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
+ExecReload=@utillinux@/bin/kill -HUP $MAINPID
|
||||||
diff --git a/speech-dispatcherd.service.in b/speech-dispatcherd.service.in
|
diff --git a/speech-dispatcherd.service.in b/speech-dispatcherd.service.in
|
||||||
index ab14b99d..12521b1b 100644
|
index ab14b99d..12521b1b 100644
|
||||||
--- a/speech-dispatcherd.service.in
|
--- a/speech-dispatcherd.service.in
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
itstool,
|
itstool,
|
||||||
libtool,
|
libtool,
|
||||||
texinfo,
|
texinfo,
|
||||||
|
systemdMinimal,
|
||||||
util-linux,
|
util-linux,
|
||||||
autoreconfHook,
|
autoreconfHook,
|
||||||
glib,
|
glib,
|
||||||
|
@ -79,6 +80,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
libpulseaudio
|
libpulseaudio
|
||||||
python
|
python
|
||||||
]
|
]
|
||||||
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
|
systemdMinimal # libsystemd
|
||||||
|
]
|
||||||
++ lib.optionals withAlsa [
|
++ lib.optionals withAlsa [
|
||||||
alsa-lib
|
alsa-lib
|
||||||
]
|
]
|
||||||
|
@ -103,6 +107,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
# Audio method falls back from left to right.
|
# Audio method falls back from left to right.
|
||||||
"--with-default-audio-method=\"libao,pulse,alsa,oss\""
|
"--with-default-audio-method=\"libao,pulse,alsa,oss\""
|
||||||
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
|
||||||
|
"--with-systemduserunitdir=${placeholder "out"}/lib/systemd/user"
|
||||||
]
|
]
|
||||||
++ lib.optionals withPulse [
|
++ lib.optionals withPulse [
|
||||||
"--with-pulse"
|
"--with-pulse"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue