about summary refs log tree commit diff
path: root/users/tazjin/nixos/modules/tgsa.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/nixos/modules/tgsa.nix')
-rw-r--r--users/tazjin/nixos/modules/tgsa.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/users/tazjin/nixos/modules/tgsa.nix b/users/tazjin/nixos/modules/tgsa.nix
index 9953ab03acae..e162e0d8228f 100644
--- a/users/tazjin/nixos/modules/tgsa.nix
+++ b/users/tazjin/nixos/modules/tgsa.nix
@@ -6,11 +6,15 @@
     wantedBy = [ "multi-user.target" ];
 
     serviceConfig = {
-      EnvironmentFile = "/root/tgsa-env"; # TODO(tazjin): automate this
       DynamicUser = true;
       Restart = "always";
-      ExecStart = "${depot.users.tazjin.tgsa}/bin/tgsa";
+      LoadCredential = "tgsa-yandex.json:/run/agenix/tgsa-yandex";
     };
+
+    script = ''
+      export YANDEX_KEY_FILE="''${CREDENTIALS_DIRECTORY}/tgsa-yandex.json"
+      ${depot.users.tazjin.tgsa}/bin/tgsa
+    '';
   };
 
   services.nginx.virtualHosts."tgsa" = {