Fix commands

This commit is contained in:
2025-08-10 20:34:22 -07:00
parent 988a38b1f9
commit 2d948073b2
5 changed files with 208 additions and 74 deletions
+11 -12
View File
@@ -1,4 +1,10 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
with lib;
@@ -11,6 +17,7 @@ in
package = mkOption {
type = types.package;
default = pkgs.callPackage ./package.nix { inherit inputs; };
description = "The systant package to use";
};
@@ -58,10 +65,10 @@ in
};
config = mkIf cfg.enable {
systemd.services.systant = {
systemd.user.services.systant = {
description = "Systant MQTT Daemon";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
wantedBy = [ "default.target" ];
environment = {
SYSTANT_MQTT_HOST = cfg.mqttHost;
@@ -77,8 +84,6 @@ in
serviceConfig = {
Type = "exec";
User = "root";
Group = "root";
ExecStart = "${cfg.package}/bin/systant start";
ExecStop = "${cfg.package}/bin/systant stop";
Restart = "always";
@@ -87,13 +92,7 @@ in
StandardError = "journal";
SyslogIdentifier = "systant";
WorkingDirectory = "${cfg.package}";
# Security settings
NoNewPrivileges = true;
PrivateTmp = true;
ProtectHome = true;
ProtectSystem = false; # Need access to system stats
};
};
};
}
}