move to systemd-timers
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
parent
0dc66dac96
commit
9007fe4d53
@ -6,10 +6,10 @@
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./cron
|
||||
./networking.nix
|
||||
./zfs.nix
|
||||
./hydra.nix
|
||||
./networking.nix
|
||||
./nextcloud.nix
|
||||
./zfs.nix
|
||||
];
|
||||
|
||||
programs.git.lfs.enable = false;
|
||||
|
37
systems/palatine-hill/nextcloud.nix
Normal file
37
systems/palatine-hill/nextcloud.nix
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
systemd.timers."nextcloud-pre-generate" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = 600;
|
||||
OnUnitActiveSec = 600;
|
||||
Unit = "nextcloud-pre-generate.service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."nextcloud-pre-generate" = {
|
||||
requires = [
|
||||
"docker.service"
|
||||
"multi-user.target"
|
||||
];
|
||||
after = [
|
||||
"docker.service"
|
||||
"multi-user.target"
|
||||
];
|
||||
description = "incrementally pre-generates previews on nextcloud";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
DynamicUser = "yes";
|
||||
Group = "docker";
|
||||
ExecStart = ''
|
||||
docker ps --format "{{.Names}}" | grep -q "^nextcloud-nextcloud-1$" && docker exec --user www-data nextcloud-nextcloud-1 php occ preview:pre-generate
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user