nixos vdr: introduce option enableLirc

also introduce option socket for lirc, to have access to socket path
This commit is contained in:
Christian Kögler
2018-12-26 22:59:06 +01:00
parent 4543559aea
commit 987fdea1a8
2 changed files with 20 additions and 4 deletions
+12 -2
View File
@@ -33,12 +33,14 @@ in {
default = [];
description = "Additional command line arguments to pass to VDR.";
};
enableLirc = mkEnableOption "enable LIRC";
};
};
###### implementation
config = mkIf cfg.enable {
config = mkIf cfg.enable (mkMerge [{
systemd.tmpfiles.rules = [
"d ${cfg.videoDir} 0755 vdr vdr -"
"Z ${cfg.videoDir} - vdr vdr -"
@@ -67,5 +69,13 @@ in {
};
users.groups.vdr = {};
};
}
(mkIf cfg.enableLirc {
services.lirc.enable = true;
users.users.vdr.extraGroups = [ "lirc" ];
services.vdr.extraArguments = [
"--lirc=${config.services.lirc.socket}"
];
})]);
}