nixos-config/configs/porani/kodi.nix

49 lines
1.1 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, lib, pkgs, ... }:
{
services.xserver = {
enable = true;
2019-12-14 06:15:37 +01:00
autorun = true;
2019-10-24 02:20:38 +02:00
desktopManager = {
kodi.enable = true;
default = "kodi";
xterm.enable = false;
};
displayManager.lightdm = {
enable = true;
autoLogin.enable = true;
autoLogin.user = config.users.users.kodi.name;
2019-12-14 06:15:37 +01:00
# todo test it
# if kodi crashes restart the whole xsession to trigger the login
2019-12-16 09:57:09 +01:00
extraConfig = let
restartScript = pkgs.writers.writeBash "cleanup"
''
trap "" SIGHUP SIGINT SIGTERM
${pkgs.systemd}/bin/systemctl restart display-manager.service
2019-12-14 06:15:37 +01:00
'';
2019-12-16 09:57:09 +01:00
in
''
session-cleanup-script=${restartScript}
'';
2019-10-24 02:20:38 +02:00
};
};
users = {
# mutableUsers = true;
users.kodi= {
isNormalUser = true;
name = "kodi";
uid = 1338;
initialPassword = lib.fileContents <secrets/kodi/password>;
};
};
2019-12-14 11:19:12 +01:00
# allow everybody in the net to access the wifi
networking.firewall = {
allowedTCPPorts = [ 8080 ];
allowedUDPPorts = [ 8080 ];
};
2019-10-24 02:20:38 +02:00
}