From dc1907bdf311f1ab31d6da994d4027403847e646 Mon Sep 17 00:00:00 2001 From: toufic ar Date: Sat, 11 Jul 2026 16:13:05 +0300 Subject: run autopush as system service --- adonis/autopush/default.nix | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/adonis/autopush/default.nix b/adonis/autopush/default.nix index bf83b7d..6055a42 100644 --- a/adonis/autopush/default.nix +++ b/adonis/autopush/default.nix @@ -10,25 +10,16 @@ autopush = pkgs.autopush-rs; in { sops.secrets = { - "autopush/autoconnect" = { - owner = "autopush"; - }; - "autopush/autoendpoint" = { - owner = "autopush"; - }; - }; - users.groups.autopush = {}; - users.users."autopush" = { - group = "autopush"; - isSystemUser = true; - useDefaultShell = true; + "autopush/autoconnect" = {}; + "autopush/autoendpoint" = {}; }; + environment.systemPackages = [autopush]; services.redis.servers."autopush" = { enable = true; port = redisPort; }; - systemd.user.services = { + systemd.services = { autopush-autoconnect = { environment = { AUTOCONNECT__DB_DSN = "redis://127.0.0.1:${builtins.toString redisPort}"; @@ -38,7 +29,6 @@ in { AUTOCONNECT__ROUTER_HOSTNAME = "127.0.0.1"; }; wantedBy = ["multi-user.target"]; - unitConfig.ConditionUser = "autopush"; serviceConfig = { EnvironmentFile = config.sops.secrets."autopush/autoconnect".path; ExecStart = "${autopush}/bin/autoconnect"; @@ -52,7 +42,6 @@ in { AUTOEND__ENDPOINT_URL = "https://update.${domain}"; }; wantedBy = ["multi-user.target"]; - unitConfig.ConditionUser = "autopush"; serviceConfig = { EnvironmentFile = config.sops.secrets."autopush/autoendpoint".path; ExecStart = "${autopush}/bin/autoendpoint"; -- cgit v1.3.1