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 example = true; 15 description = "Enable the kodi multimedia center."; 16 }; 17 }; 18 }; 19 20 config = mkIf cfg.enable { 21 services.xserver.desktopManager.session = [{ 22 name = "kodi"; 23 start = '' 24 ${pkgs.kodi}/bin/kodi --lircdev /var/run/lirc/lircd --standalone & 25 waitPID=$! 26 ''; 27 }]; 28 29 environment.systemPackages = [ pkgs.kodi ]; 30 }; 31}