Merge pull request #260091 from bendlas/fix-cdemu-service
cdemu: fix service setup
This commit is contained in:
commit
a5e03844dc
2 changed files with 22 additions and 1 deletions
|
@ -53,6 +53,19 @@ in {
|
||||||
dbus.packages = [ pkgs.cdemu-daemon ];
|
dbus.packages = [ pkgs.cdemu-daemon ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
users.groups.${config.programs.cdemu.group} = {};
|
||||||
|
|
||||||
|
# Systemd User service
|
||||||
|
# manually adapted from example in source package:
|
||||||
|
# https://sourceforge.net/p/cdemu/code/ci/master/tree/cdemu-daemon/service-example/cdemu-daemon.service
|
||||||
|
systemd.user.services.cdemu-daemon.description = "CDEmu daemon";
|
||||||
|
systemd.user.services.cdemu-daemon.serviceConfig = {
|
||||||
|
Type = "dbus";
|
||||||
|
BusName = "net.sf.cdemu.CDEmuDaemon";
|
||||||
|
ExecStart = "${pkgs.cdemu-daemon}/bin/cdemu-daemon --config-file \"%h/.config/cdemu-daemon\"";
|
||||||
|
Restart = "no";
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages =
|
environment.systemPackages =
|
||||||
[ pkgs.cdemu-daemon pkgs.cdemu-client ]
|
[ pkgs.cdemu-daemon pkgs.cdemu-client ]
|
||||||
++ optional cfg.gui pkgs.gcdemu
|
++ optional cfg.gui pkgs.gcdemu
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ callPackage, glib, libao, intltool, libmirage }:
|
{ callPackage, glib, libao, intltool, libmirage, coreutils }:
|
||||||
let pkg = import ./base.nix {
|
let pkg = import ./base.nix {
|
||||||
version = "3.2.5";
|
version = "3.2.5";
|
||||||
pname = "cdemu-daemon";
|
pname = "cdemu-daemon";
|
||||||
|
@ -7,4 +7,12 @@ let pkg = import ./base.nix {
|
||||||
in callPackage pkg {
|
in callPackage pkg {
|
||||||
nativeBuildInputs = [ intltool ];
|
nativeBuildInputs = [ intltool ];
|
||||||
buildInputs = [ glib libao libmirage ];
|
buildInputs = [ glib libao libmirage ];
|
||||||
|
drvParams.postInstall = ''
|
||||||
|
mkdir -p $out/share/dbus-1/services
|
||||||
|
cp -R ../$pname-$version/service-example $out/share/cdemu
|
||||||
|
substitute \
|
||||||
|
$out/share/cdemu/net.sf.cdemu.CDEmuDaemon.service \
|
||||||
|
$out/share/dbus-1/services/net.sf.cdemu.CDEmuDaemon.service \
|
||||||
|
--replace /bin/true ${coreutils}/bin/true
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue