nixpkgs/nixos/modules/services/x11/desktop-managers/kodi.nix

42 lines
923 B
Nix
Raw Normal View History

2015-01-19 22:14:36 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.xserver.desktopManager.kodi;
in
{
options = {
services.xserver.desktopManager.kodi = {
enable = mkOption {
type = types.bool;
2015-01-19 22:14:36 +01:00
default = false;
description = "Enable the kodi multimedia center.";
};
2021-03-29 22:47:30 +02:00
package = mkOption {
type = types.package;
default = pkgs.kodi;
defaultText = "pkgs.kodi";
example = "pkgs.kodi.withPackages (p: with p; [ jellyfin pvr-iptvsimple vfs-sftp ])";
description = ''
Package that should be used for Kodi.
'';
};
2015-01-19 22:14:36 +01:00
};
};
config = mkIf cfg.enable {
services.xserver.desktopManager.session = [{
name = "kodi";
start = ''
2021-03-29 22:47:30 +02:00
LIRC_SOCKET_PATH=/run/lirc/lircd ${cfg.package}/bin/kodi --standalone &
2015-01-19 22:14:36 +01:00
waitPID=$!
'';
}];
2021-03-29 22:47:30 +02:00
environment.systemPackages = [ cfg.package ];
2015-01-19 22:14:36 +01:00
};
}