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;
|
2022-08-12 12:06:08 +00:00
|
|
|
description = lib.mdDoc "Enable the kodi multimedia center.";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
package = mkPackageOption pkgs "kodi" {
|
|
|
|
example = "kodi.withPackages (p: with p; [ jellyfin pvr-iptvsimple vfs-sftp ])";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
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
|
|
|
};
|
|
|
|
}
|