nixos/lirc: expose socket path via passthru

This commit is contained in:
Jörg Thalheim 2019-01-05 13:22:39 +01:00
parent 987fdea1a8
commit 9b2f0fbcdd
No known key found for this signature in database
GPG Key ID: CA4106B8D7CC79FA
2 changed files with 4 additions and 10 deletions

View File

@ -32,14 +32,6 @@ in {
default = [];
description = "Extra arguments to lircd.";
};
socket = mkOption {
type = types.path;
# default search path of many applications
default = "/run/lirc/lircd";
description = "Socket path";
};
};
};
@ -50,13 +42,15 @@ in {
# Note: LIRC executables raises a warning, if lirc_options.conf do not exists
environment.etc."lirc/lirc_options.conf".text = cfg.options;
passthru.lirc.socket = "/run/lirc/lircd";
environment.systemPackages = [ pkgs.lirc ];
systemd.sockets.lircd = {
description = "LIRC daemon socket";
wantedBy = [ "sockets.target" ];
socketConfig = {
ListenStream = cfg.socket;
ListenStream = config.passthru.lirc.socket;
SocketUser = "lirc";
SocketMode = "0660";
};

View File

@ -75,7 +75,7 @@ in {
services.lirc.enable = true;
users.users.vdr.extraGroups = [ "lirc" ];
services.vdr.extraArguments = [
"--lirc=${config.services.lirc.socket}"
"--lirc=${config.passthru.lirc.socket}"
];
})]);
}