desktops: add kodi
This commit is contained in:
parent
4dcd919ba8
commit
13c21d9d15
3 changed files with 88 additions and 7 deletions
options/custom
|
@ -35,12 +35,7 @@ in {
|
|||
rounding = mkOption {default = 16.0;};
|
||||
|
||||
### Misc
|
||||
desktop = mkOption {
|
||||
default =
|
||||
if config.custom.full
|
||||
then "niri"
|
||||
else "gnome";
|
||||
};
|
||||
desktop = mkOption {default = null;};
|
||||
|
||||
lockscreen = mkOption {default = "hyprlock";};
|
||||
menu = mkOption {default = "rofi";};
|
||||
|
|
|
@ -7,7 +7,7 @@ with lib; let
|
|||
cfg = config.custom.desktops;
|
||||
in {
|
||||
options.custom.desktops = {
|
||||
enable = mkOption {default = config.custom.minimal;};
|
||||
enable = mkOption {default = isString config.custom.desktop;};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -15,6 +15,7 @@ in {
|
|||
gnome.enable = config.custom.desktop == "gnome";
|
||||
hyprland.enable = config.custom.desktop == "hyprland";
|
||||
kde.enable = config.custom.desktop == "kde";
|
||||
kodi.enable = config.custom.desktop == "kodi";
|
||||
niri.enable = config.custom.desktop == "niri";
|
||||
sway.enable = config.custom.desktop == "sway";
|
||||
};
|
||||
|
|
85
options/custom/desktops/kodi/default.nix
Normal file
85
options/custom/desktops/kodi/default.nix
Normal file
|
@ -0,0 +1,85 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.custom.desktops.kodi;
|
||||
hm = config.home-manager.users.${config.custom.username};
|
||||
in {
|
||||
options.custom.desktops.kodi = {
|
||||
enable = mkOption {default = false;};
|
||||
firewall = mkOption {default = false;};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# https://github.com/xbmc/xbmc
|
||||
# https://kodi.wiki/view/Main_Page
|
||||
# https://wiki.archlinux.org/title/Kodi
|
||||
# https://wiki.nixos.org/wiki/Kodi
|
||||
services = {
|
||||
displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = "kodi";
|
||||
};
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
displayManager.lightdm.greeter.enable = false;
|
||||
|
||||
desktopManager.kodi = {
|
||||
enable = true;
|
||||
|
||||
# https://wiki.nixos.org/wiki/Kodi#Plugins
|
||||
package = pkgs.unstable.kodi-gbm.withPackages (kodiPackages:
|
||||
with kodiPackages; [
|
||||
youtube # https://github.com/anxdpanic/plugin.video.youtube
|
||||
]);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# https://kodi.wiki/view/Smartphone/tablet_remotes#Firewall
|
||||
# https://wiki.nixos.org/wiki/Kodi#Access_from_other_machines
|
||||
networking.firewall = mkIf cfg.firewall {
|
||||
allowedTCPPorts = [8080];
|
||||
allowedUDPPorts = [9777];
|
||||
};
|
||||
|
||||
users.users.kodi = {
|
||||
isNormalUser = true;
|
||||
};
|
||||
|
||||
home-manager.users.kodi = {
|
||||
home = {
|
||||
homeDirectory = "/home/kodi";
|
||||
stateVersion = hm.home.stateVersion;
|
||||
username = "kodi";
|
||||
};
|
||||
|
||||
programs = {
|
||||
home-manager.enable = true;
|
||||
|
||||
kodi = {
|
||||
enable = true;
|
||||
package = config.services.xserver.desktopManager.kodi.package;
|
||||
|
||||
# advancedsettings.xml
|
||||
# https://kodi.wiki/view/Advancedsettings.xml
|
||||
settings = {
|
||||
# guisettings.xml
|
||||
# https://kodi.wiki/view/Advancedsettings.xml#guisettings.xml_Setting_Conversion
|
||||
# https://github.com/xbmc/xbmc/blob/master/system/settings/settings.xml
|
||||
|
||||
# https://kodi.wiki/view/Webserver
|
||||
services = {
|
||||
webserver = "true";
|
||||
webserverauthentication = "false";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue