[app-launcher] Add app-launcher to boxy
This commit is contained in:
@@ -4,6 +4,7 @@ with lib;
|
||||
|
||||
let
|
||||
cfg = config.roles.kodi;
|
||||
customPkgs = pkgs.callPackage ../../packages {};
|
||||
in
|
||||
{
|
||||
options.roles.kodi = {
|
||||
@@ -14,6 +15,18 @@ in
|
||||
wayland = mkOption {
|
||||
default = true;
|
||||
};
|
||||
appLauncherServer = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable HTTP app launcher server for remote control";
|
||||
};
|
||||
port = mkOption {
|
||||
type = types.int;
|
||||
default = 8081;
|
||||
description = "Port for the app launcher HTTP server";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -33,17 +46,35 @@ in
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 8080 ];
|
||||
allowedTCPPorts = [ 8080 ] ++ optional cfg.appLauncherServer.enable cfg.appLauncherServer.port;
|
||||
allowedUDPPorts = [ 8080 ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
kodiPkg
|
||||
wget
|
||||
];
|
||||
firefox
|
||||
] ++ optional cfg.appLauncherServer.enable customPkgs.app-launcher-server;
|
||||
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
systemd.user.services = mkIf cfg.appLauncherServer.enable {
|
||||
app-launcher-server = {
|
||||
description = "HTTP App Launcher Server";
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
after = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${customPkgs.app-launcher-server}/bin/app-launcher-server ${toString cfg.appLauncherServer.port}";
|
||||
Restart = "always";
|
||||
RestartSec = "5s";
|
||||
Environment = [
|
||||
"PATH=${pkgs.firefox}/bin:${kodiPkg}/bin:/run/current-system/sw/bin"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services = if cfg.autologin then {
|
||||
displayManager = {
|
||||
autoLogin.enable = true;
|
||||
|
||||
Reference in New Issue
Block a user