buildbot/nix-eval Build done.
buildbot/nix-build gitea:greg/nixos#checks.aarch64-darwin.pkg-adblock_update Build done.
buildbot/nix-build Build done.
Update flake.lock / update-flake-lock (push) Failing after 8s
Update manifest chart versions / update-manifests (push) Successful in 4s
36 lines
763 B
Nix
36 lines
763 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.greg.adblockUpdate;
|
|
in
|
|
{
|
|
|
|
options.greg.adblockUpdate = {
|
|
enable = lib.mkEnableOption "Enable auto-update of block list";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
systemd = {
|
|
services.adblock-update = {
|
|
after = [ "network-online.target" ];
|
|
requires = [ "network-online.target" ];
|
|
script = lib.getExe pkgs.adblockUpdate;
|
|
serviceConfig.Type = "oneshot";
|
|
};
|
|
timers.adblock-update = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "network-online.target" ];
|
|
requires = [ "network-online.target" ];
|
|
timerConfig = {
|
|
OnCalendar = "daily";
|
|
Unit = "adblock-update.service";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|