Add a kodi role

This commit is contained in:
2024-09-07 17:12:22 -07:00
parent c61ee69500
commit 4ba82961cd
3 changed files with 30 additions and 4 deletions

26
roles/kodi/default.nix Normal file
View File

@@ -0,0 +1,26 @@
{ autologin ? false, pkgs, ... }:
{
services.xserver.desktopManager.kodi = {
enable = true;
package = pkgs.kodi.withPackages (pkgs: with pkgs; [
jellyfin
]);
};
users.extraUsers.kodi.isNormalUser = true;
networking.firewall = {
allowedTCPPorts = [ 8080 ];
allowedUDPPorts = [ 8080 ];
};
services.displayManager = if autologin then {
autoLogin.enable = true;
autoLogin.user = "kodi";
defaultSession = "kodi";
} else {};
services.xserver.displayManager = if autologin then {
lightdm.enable = true;
lightdm.greeter.enable = false;
} else {};
}