{ pkgs, ... }: let build-flake-script = pkgs.writeShellApplication { name = "build-flake-script"; runtimeInputs = with pkgs; [ git nix nixos-rebuild jq curl ]; text = builtins.readFile ./build-flakes.sh; }; in { systemd.services."build-flakes" = { serviceConfig = { Type = "exec"; ExecStart = "${build-flake-script}/bin/build-flake-script"; }; }; systemd.timers."build-flakes" = { enable = true; wantedBy = [ "timers.target" ]; timerConfig = { OnCalendar = "*-*-* *:30:00"; }; }; }