servo: deploy a service which periodically rebuilds my nix config to populate the cache

This commit is contained in:
Colin 2023-12-12 02:13:59 +00:00
parent f1e59061d7
commit e4f1cfb53f
2 changed files with 23 additions and 0 deletions

View File

@ -22,6 +22,7 @@
./monero.nix
./navidrome.nix
./nginx.nix
./nixos-prebuild.nix
./nixserve.nix
./ntfy
./pict-rs.nix

View File

@ -0,0 +1,22 @@
{ pkgs, ... }:
{
systemd.services.nixos-prebuild = {
description = "build a nixos image with all updated deps";
path = with pkgs; [ coreutils git nix ];
script = ''
working=$(mktemp -d /tmp/nixos-prebuild.XXXXXX)
pushd "$working"
git clone https://git.uninsane.org/colin/nix-files.git
cd nix-files
nix flake update
nix run '.#check' -- -j1 --cores 5
popd
rm -rf "$working"
'';
};
systemd.timers.nixos-prebuild = {
wantedBy = [ "multi-user.target" ];
timerConfig.OnCalendar = "11,23:00:00";
};
}