feat(tsuba): Add image pruning systemd timer
Some checks failed
Flake checker / Build Nix targets (push) Has been cancelled
Some checks failed
Flake checker / Build Nix targets (push) Has been cancelled
This commit is contained in:
@@ -5,8 +5,6 @@
|
|||||||
device,
|
device,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
virtualisation.docker.enable = true;
|
|
||||||
virtualisation.oci-containers.backend = "docker";
|
|
||||||
users.extraUsers.servius.extraGroups = ["docker"];
|
users.extraUsers.servius.extraGroups = ["docker"];
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = false;
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|||||||
@@ -12,5 +12,6 @@
|
|||||||
./monitoring.nix
|
./monitoring.nix
|
||||||
./pihole.nix
|
./pihole.nix
|
||||||
./resolved.nix
|
./resolved.nix
|
||||||
|
./docker.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
21
nixos/tsuba/services/docker.nix
Normal file
21
nixos/tsuba/services/docker.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
virtualisation.oci-containers.backend = "docker";
|
||||||
|
systemd.services.docker-prune-image = {
|
||||||
|
description = "Docker prune unused images";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "${pkgs.docker}/bin/docker image prune -f";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.timers.docker-prune-image = {
|
||||||
|
description = "Timer for docker image prune";
|
||||||
|
wantedBy = ["timers.target"];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = "Mon *-*-* 02:00:00";
|
||||||
|
OnUnitInactiveSec = "6d";
|
||||||
|
Persistent = true;
|
||||||
|
RandomizedDelaySec = "1h";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
description = "Pull latest Jellyfin Docker image";
|
description = "Pull latest Jellyfin Docker image";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "${pkgs.docker}/bin/docker pull ghcr.io/jellyfin/jellyfin:latest";
|
ExecStart = "${pkgs.docker}/bin/docker pull jellyfin/jellyfin:latest";
|
||||||
ExecStartPost = "${pkgs.systemd}/bin/systemctl restart docker-jellyfin.service";
|
ExecStartPost = "${pkgs.systemd}/bin/systemctl restart docker-jellyfin.service";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user