Setup wayland + autologin conditionals

This commit is contained in:
2024-09-08 12:18:31 -07:00
parent 460585832b
commit 690220634b
3 changed files with 33 additions and 25 deletions

View File

@@ -1,7 +1,10 @@
{ autologin ? false, pkgs, ... }:
{ autologin ? false, wayland ? false, lib, pkgs, ... }:
with lib;
let
kodiPkg = pkgs.kodi-wayland.withPackages (pkgs: with pkgs; [
kodiBasePkg = if wayland then pkgs.kodi-wayland else pkgs.kodi;
kodiPkg = kodiBasePkg.withPackages (pkgs: with pkgs; [
jellyfin
steam-launcher
steam-library
@@ -11,29 +14,34 @@ in
{
users.extraUsers.kodi.isNormalUser = true;
services.cage.user = "kodi";
services.cage.program = "${kodiPkg}/bin/kodi-standalone";
services.cage.enable = true;
#services.xserver.enable = true;
#services.xserver.desktopManager.kodi = {
#enable = true;
#package = kodiPkg;
#};
#services.displayManager = if autologin then {
# autoLogin.enable = true;
# autoLogin.user = "kodi";
# defaultSession = "kodi";
# sessionData.autologinSession = "kodi";
#} else {};
#services.xserver.displayManager = if autologin then {
# lightdm.enable = true;
# lightdm.greeter.enable = false;
#} else {};
networking.firewall = {
allowedTCPPorts = [ 8080 ];
allowedUDPPorts = [ 8080 ];
};
services = mkIf autologin {
cage = mkIf wayland {
user = "kodi";
program = "${kodiPkg}/bin/kodi-standalone";
enable = true;
};
xserver = mkIf (!wayland) {
enable = true;
desktopManager.kodi = {
enable = true;
package = kodiPkg;
};
displayManager.lightdm = {
enable = true;
greeter.enable = false;
};
};
displayManager = mkIf (!wayland) {
autoLogin.enable = true;
autoLogin.user = "kodi";
defaultSession = "kodi";
sessionData.autologinSession = "kodi";
};
};
}