1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.services.xserver.desktopManager.kodi;
7in
8
9{
10 options = {
11 services.xserver.desktopManager.kodi = {
12 enable = mkOption {
13 default = false;
14 description = "Enable the kodi multimedia center.";
15 };
16 };
17 };
18
19 config = mkIf cfg.enable {
20 services.xserver.desktopManager.session = [{
21 name = "kodi";
22 start = ''
23 ${pkgs.kodi}/bin/kodi --lircdev /var/run/lirc/lircd --standalone &
24 waitPID=$!
25 '';
26 }];
27
28 environment.systemPackages = [ pkgs.kodi ];
29 };
30}