3
0
Fork 0
forked from mirrors/nixpkgs

nixos/mastodon: fix definition of mastodon-media-auto-remove

This commit is contained in:
Justinas Stankevicius 2022-11-12 00:05:10 +02:00 committed by Kerstin
parent 702a4dd0e2
commit 3f6eb10dbd
2 changed files with 10 additions and 7 deletions

View file

@ -623,15 +623,15 @@ in {
environment = env;
serviceConfig = {
Type = "oneshot";
script = let
olderThanDays = toString cfg.mediaAutoRemove.olderThanDays;
in ''
${cfg.package}/bin/tootctl media remove --days=${olderThanDays}
${cfg.package}/bin/tootctl preview_cards remove --days=${olderThanDays}
'';
EnvironmentFile = "/var/lib/mastodon/.secrets_env";
startAt = cfg.mediaAutoRemove.startAt;
} // cfgService;
script = let
olderThanDays = toString cfg.mediaAutoRemove.olderThanDays;
in ''
${cfg.package}/bin/tootctl media remove --days=${olderThanDays}
${cfg.package}/bin/tootctl preview_cards remove --days=${olderThanDays}
'';
startAt = cfg.mediaAutoRemove.startAt;
};
services.nginx = lib.mkIf cfg.configureNginx {

View file

@ -129,6 +129,9 @@ in
ca.wait_for_unit("step-ca.service")
ca.wait_for_open_port(8443)
# Check that mastodon-media-auto-remove is scheduled
server.succeed("systemctl status mastodon-media-auto-remove.timer")
server.wait_for_unit("nginx.service")
server.wait_for_unit("redis-mastodon.service")
server.wait_for_unit("postgresql.service")