fix(discord): configure jellyfin-rpc on activation rather than before service
This commit is contained in:
@@ -67,6 +67,23 @@ in {
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
home.activation.jellyfin-rpc-configure =
|
||||
let
|
||||
jq = lib.getExe pkgs.jq;
|
||||
api-key-file = config.sops.secrets.jellyfin-rpc-api-key.path;
|
||||
in lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
dest=''${XDG_CONFIG_HOME:-$HOME/.config}/jellyfin-rpc/main.json
|
||||
um=$(umask)
|
||||
mkdir -p "$(dirname "$dest")"
|
||||
umask 177
|
||||
[[ -f "$dest" ]] && chmod 600 "$dest"
|
||||
jq < ${jellyfin-rpc-config-template} > "$dest" \
|
||||
--rawfile api_key ${api-key-file} \
|
||||
'.jellyfin.api_key = $api_key'
|
||||
umask $(um)
|
||||
'';
|
||||
|
||||
systemd.user.services.jellyfin-rpc = {
|
||||
Unit = {
|
||||
After = ["jellyfin-rpc-configure"];
|
||||
|
||||
Reference in New Issue
Block a user