restructure dockers, add watchtower
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
{
|
||||
options = {
|
||||
modules.homelab.ddns_docker.enable = lib.mkEnableOption "enable ddns docker";
|
||||
modules.homelab.docker.ddns.enable = lib.mkEnableOption "enable ddns docker";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.homelab.ddns_docker.enable {
|
||||
config = lib.mkIf config.modules.homelab.docker.ddns.enable {
|
||||
let
|
||||
api_token = builtins.readFile /home/blake/.keyring/ddns/api_token;
|
||||
zone_id_blakedheld = builtins.readFile /home/blake/.keyring/ddns/zone_id_blakedheld;
|
||||
13
modules/homelab/docker/dockers.nix
Normal file
13
modules/homelab/docker/dockers.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./watchtowner.nix
|
||||
./ddns.nix
|
||||
];
|
||||
|
||||
modules.homelab.docker.watchtower.enable = lib.mkDefault true;
|
||||
modules.homelab.docker.ddns.enable = lib.mkDefault false;
|
||||
|
||||
}
|
||||
23
modules/homelab/docker/watchtower.nix
Normal file
23
modules/homelab/docker/watchtower.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
options = {
|
||||
modules.homelab.docker.watchtower.enable = lib.mkEnableOption "enable watchtower docker";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.homelab.docker.watchtower.enable {
|
||||
virtualisation.docker.containers.watchtower = {
|
||||
image = "containrrr/watchtower";
|
||||
containerName = "watchtower";
|
||||
restartPolicy = "unless-stopped";
|
||||
environment = {
|
||||
TZ = "America/Chicago";
|
||||
WATCHTOWER_INCLUDE_RESTARTING = "America/Chicago";
|
||||
WATCHTOWER_CLEANUP = "true";
|
||||
WATCHTOWER_POLL_INTERVAL = "43200";
|
||||
};
|
||||
volumes = [ "/var/run/docker.sock:/var/run/docker.sock" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user