init commit
This commit is contained in:
commit
181e6f681e
22 changed files with 940 additions and 0 deletions
24
scripts/virtualisation/update-containers.nix
Normal file
24
scripts/virtualisation/update-containers.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
systemd.timers.update-containers = {
|
||||
timerConfig = {
|
||||
Unit = "update-containers.service";
|
||||
OnCalendar = "Mon 02:30";
|
||||
};
|
||||
wantedBy = [ "timers.target" ];
|
||||
};
|
||||
systemd.services.update-containers = {
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = lib.getExe (pkgs.writeShellScriptBin "update-containers" ''
|
||||
images=$(${pkgs.podman}/bin/podman ps -a --format="{{.Image}}" | sort -u)
|
||||
|
||||
for image in $images; do
|
||||
${pkgs.podman}/bin/podman pull "$image"
|
||||
done
|
||||
'');
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue