From 74fd3272080703b75517b77b7df26afe39181bbc Mon Sep 17 00:00:00 2001 From: niten Date: Sun, 19 Jun 2022 12:28:59 -0700 Subject: [PATCH] Switch from ExecStartPre to LoadCredential. ExecStartPre %u and %T were relative to root. --- module.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/module.nix b/module.nix index 99fc6a4..852c12a 100644 --- a/module.nix +++ b/module.nix @@ -63,16 +63,15 @@ in { environment = { PRICEBOT_EXCHANGE_HOST = cfg.exchange-host; PRICEBOT_BEBOT_URL = cfg.mattermost-url; - PRICEBOT_BEBOT_AUTH_TOKEN_FILE = "%T/auth.token"; + PRICEBOT_BEBOT_AUTH_TOKEN_FILE = "$CREDENTIALS_DIRECTORY/auth.token"; PRICEBOT_BEBOT_CHANNEL_ID = opts.mattermost-channel-id; PRICEBOT_TARGET_CURRENCY = opts.currency; PRICEBOT_NOTIFY_USER = opts.notify-user; }; serviceConfig = { ExecStart = "${pricebot}/bin/pricebot"; - ExecStartPre = - "+${pkgs.coreutils-full}/bin/install --owner=%u --mode=400 -T ${cfg.mattermost-auth-token-file} %T/auth.token"; DynamicUser = true; + LoadCredential = "auth.token:${cfg.mattermost-auth-token-file}"; PrivateTmp = true; PrivateDevices = true; ProtectSystem = "strict";