Add panel-api service and update panelctl script for container management

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Jakub Dorfman 2026-04-26 19:42:47 +02:00
parent c8ea1761ed
commit 49534ed568
2 changed files with 33 additions and 0 deletions

View file

@ -9,7 +9,9 @@
pkgs.vim
pkgs.git
pkgs.agenix
pkgs.python3
pkgs.podman-compose
(pkgs.writeShellScriptBin "panelctl" (builtins.readFile ./panel/panelctl.sh))
];
virtualisation.podman = {
@ -46,6 +48,29 @@
"f /home/reudy/containers/routes/_placeholder.caddy 0640 reudy panelroutes -"
];
systemd.services.panel-api = {
description = "Minimal panel API service";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
User = "reudy";
Group = "panelroutes";
Restart = "always";
RestartSec = 3;
WorkingDirectory = "/home/reudy";
ExecStart = "${pkgs.python3}/bin/python3 ${./panel/panel-api.py}";
};
environment = {
PANEL_API_BIND = "127.0.0.1";
PANEL_API_PORT = "9911";
PANEL_BASE_DIR = "/home/reudy/containers";
PANELCTL_PATH = "/run/current-system/sw/bin/panelctl";
};
};
security.sudo.wheelNeedsPassword = true;