2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.xserver.desktopManager.kodi;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.xserver.desktopManager.kodi = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Enable the kodi multimedia center.";
|
|
|
|
};
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.kodi;
|
2021-10-06 13:57:05 +00:00
|
|
|
defaultText = literalExpression "pkgs.kodi";
|
|
|
|
example = literalExpression "pkgs.kodi.withPackages (p: with p; [ jellyfin pvr-iptvsimple vfs-sftp ])";
|
2021-04-05 15:23:46 +00:00
|
|
|
description = ''
|
|
|
|
Package that should be used for Kodi.
|
|
|
|
'';
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.xserver.desktopManager.session = [{
|
|
|
|
name = "kodi";
|
|
|
|
start = ''
|
2021-04-05 15:23:46 +00:00
|
|
|
LIRC_SOCKET_PATH=/run/lirc/lircd ${cfg.package}/bin/kodi --standalone &
|
2020-04-24 23:36:52 +00:00
|
|
|
waitPID=$!
|
|
|
|
'';
|
|
|
|
}];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
environment.systemPackages = [ cfg.package ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|