diff options
| author | toufic ar <contact@toufy.me> | 2026-07-11 16:13:05 +0300 |
|---|---|---|
| committer | toufic ar <contact@toufy.me> | 2026-07-11 16:13:05 +0300 |
| commit | dc1907bdf311f1ab31d6da994d4027403847e646 (patch) | |
| tree | 740d68954bd683e2f776b4e27632afe02f2944ce | |
| parent | 4d5fc0f74ca52ae3b7548fdadf61744b0be5cf40 (diff) | |
| download | servers-dc1907bdf311f1ab31d6da994d4027403847e646.tar.gz servers-dc1907bdf311f1ab31d6da994d4027403847e646.zip | |
run autopush as system service
| -rw-r--r-- | adonis/autopush/default.nix | 19 |
1 files 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"; |
