forked from mirrors/nixpkgs
nixos vdr: introduce option enableLirc
also introduce option socket for lirc, to have access to socket path
This commit is contained in:
parent
4543559aea
commit
987fdea1a8
|
@ -33,6 +33,13 @@ in {
|
||||||
description = "Extra arguments to lircd.";
|
description = "Extra arguments to lircd.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
socket = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
# default search path of many applications
|
||||||
|
default = "/run/lirc/lircd";
|
||||||
|
description = "Socket path";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -49,8 +56,7 @@ in {
|
||||||
description = "LIRC daemon socket";
|
description = "LIRC daemon socket";
|
||||||
wantedBy = [ "sockets.target" ];
|
wantedBy = [ "sockets.target" ];
|
||||||
socketConfig = {
|
socketConfig = {
|
||||||
# default search path
|
ListenStream = cfg.socket;
|
||||||
ListenStream = "/run/lirc/lircd";
|
|
||||||
SocketUser = "lirc";
|
SocketUser = "lirc";
|
||||||
SocketMode = "0660";
|
SocketMode = "0660";
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,12 +33,14 @@ in {
|
||||||
default = [];
|
default = [];
|
||||||
description = "Additional command line arguments to pass to VDR.";
|
description = "Additional command line arguments to pass to VDR.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableLirc = mkEnableOption "enable LIRC";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable (mkMerge [{
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d ${cfg.videoDir} 0755 vdr vdr -"
|
"d ${cfg.videoDir} 0755 vdr vdr -"
|
||||||
"Z ${cfg.videoDir} - vdr vdr -"
|
"Z ${cfg.videoDir} - vdr vdr -"
|
||||||
|
@ -67,5 +69,13 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
users.groups.vdr = {};
|
users.groups.vdr = {};
|
||||||
};
|
}
|
||||||
|
|
||||||
|
(mkIf cfg.enableLirc {
|
||||||
|
services.lirc.enable = true;
|
||||||
|
users.users.vdr.extraGroups = [ "lirc" ];
|
||||||
|
services.vdr.extraArguments = [
|
||||||
|
"--lirc=${config.services.lirc.socket}"
|
||||||
|
];
|
||||||
|
})]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue