Merge pull request #52943 from ck3d/vdr-enableLirc

nixos vdr: introduce option enableLirc

Changed files
+15 -5
nixos
modules
services
hardware
+3 -3
nixos/modules/services/hardware/lirc.nix
···
default = [];
description = "Extra arguments to lircd.";
};
-
};
};
···
# 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 = {
-
# default search path
-
ListenStream = "/run/lirc/lircd";
+
ListenStream = config.passthru.lirc.socket;
SocketUser = "lirc";
SocketMode = "0660";
};
+12 -2
nixos/modules/services/hardware/vdr.nix
···
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 -"
···
};
users.groups.vdr = {};
-
};
+
}
+
+
(mkIf cfg.enableLirc {
+
services.lirc.enable = true;
+
users.users.vdr.extraGroups = [ "lirc" ];
+
services.vdr.extraArguments = [
+
"--lirc=${config.passthru.lirc.socket}"
+
];
+
})]);
}