fix(nixos): add operator to homelab-operators and configure daemon systemd sandbox
Core Architecture & Invariant CI / validate (pull_request) Failing after 1m2s

Closes #4
This commit is contained in:
kiskaadee committed 2026-10-19 15:38:59 -05:00
1 parent 0b5ba58ecf
commit 2668dcc5a8
3 files changed
+8 -3

No files matched your search

+1
View File
@@ -65,6 +65,7 @@
extraGroups = [
"wheel" # sudo access
"docker" # run docker without sudo
"homelab-operators" # access /run/homelab/appctl.sock
"networkmanager" # modify network settings
];
};
+6 -2
View File
@@ -109,7 +109,7 @@
serviceConfig = {
Type = "simple";
User = config.homelab.operatorUser;
SupplementaryGroups = [ "docker" ];
SupplementaryGroups = [ "docker" "homelab-operators" ];
WorkingDirectory = config.homelab.coreDir;
ExecStart = "${pkgs.webhook}/bin/webhook -hooks ${pkgs.writeText "hooks.json" (builtins.toJSON [
{
@@ -137,12 +137,13 @@
ReadWritePaths = [
config.homelab.sitesDir
"/home/${config.homelab.operatorUser}/.local/state/homelab"
"/run/homelab"
];
};
};
# Declarative Users and Groups for Control Plane Service Identity
users.groups.homelab-operators = {};
users.groups.homelab-operators.members = [ config.homelab.operatorUser ];
users.users.homelab-appctl = {
isSystemUser = true;
group = "homelab-operators";
@@ -168,6 +169,9 @@
];
environment = {
HOME = "/var/lib/homelab/appctl";
DOCKER_CONFIG = "/var/lib/homelab/appctl/.docker";
HOMELAB_DOMAIN = config.homelab.domain;
APPCTL_SOCKET_PATH = "/run/homelab/appctl.sock";
APPCTL_HTTP_HOST = "127.0.0.1";
APPCTL_HTTP_PORT = "9001";
+1 -1
View File
@@ -484,7 +484,7 @@ class AppctlDaemon:
try:
os.chmod(self.socket_path, 0o660)
except OSError as e:
logger.warning("Could not set mode 0660 on socket %s: %e", self.socket_path, e)
logger.warning("Could not set mode 0660 on socket %s: %s", self.socket_path, e)
# 2. Prepare and bind TCP listener
self.tcp_server = ThreadingHTTPServer((self.http_host, self.http_port), AppctlHTTPHandler)