servo: deploy a service which periodically rebuilds my nix config to populate the cache
This commit is contained in:
parent
f1e59061d7
commit
e4f1cfb53f
|
@ -22,6 +22,7 @@
|
|||
./monero.nix
|
||||
./navidrome.nix
|
||||
./nginx.nix
|
||||
./nixos-prebuild.nix
|
||||
./nixserve.nix
|
||||
./ntfy
|
||||
./pict-rs.nix
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue