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

View File

@@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ inputs, pkgs, ... }:
{ inputs, lib, pkgs, ... }:
{
imports =
@@ -11,6 +11,7 @@
../../roles/common/default.nix
(import ../../roles/desktop/default.nix { x11Only = true; inherit inputs; inherit pkgs; })
../../roles/kids/default.nix
(import ../../roles/kodi/default.nix { autologin = false; inherit lib; inherit pkgs; })
../../roles/nfs-mounts/default.nix
../../roles/nix/default.nix
../../roles/printing/default.nix

View File

@@ -7,9 +7,8 @@
options = "caps:escape";
};
services.xserver.enable = true;
services.displayManager = {
sddm.enable = true;
sddm.wayland.enable = !x11Only;
services.xserver.displayManager = {
lightdm.enable = true;
};
services.desktopManager.plasma6.enable = true;
programs.hyprland = {

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 {};
}