blob: 4fa0706a2b0b1dff188a4990bc88a95a28e70c6e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# modules/containers/watchtower/default.nix
#
# I don't want to login and manually update my containers.
{
config,
lib,
...
}:
with lib;
let
service = "watchtower";
cfg = config.modules.containers.${service};
in
{
options.modules.containers.${service} = {
enable = mkEnableOption service;
};
config = mkIf cfg.enable {
virtualisation.oci-containers.containers.${service} = {
image = "containrrr/watchtower:latest";
autoStart = true;
volumes = [
"/var/run/podman/podman.sock:/var/run/docker.sock:ro"
"/etc/localtime:/etc/localtime:ro"
];
environment = {
WATCHTOWER_CLEANUP = "true";
WATCHTOWER_SCHEDULE = "0 0 5 * * *";
};
};
};
}
|