{ pkgs, ... }: {
  # Need to increase this because the number of 
  # containers I have drive the defaults over the max
  boot.kernel.sysctl = { 
    "fs.inotify.max_user_watches" = 52428800;
    "fs.inotify.max_user_instances" = 4096;

  };

  # Allow Docker containers to access Tailscale network
  networking.firewall = {
    trustedInterfaces = [ "tailscale0" ];
    allowedUDPPorts = [ 41641 ]; # Tailscale port
  };

  virtualisation.docker = {
    enable = true;
    enableOnBoot = true;
    liveRestore = true;
    autoPrune = {
      enable = true; 
      dates = "weekly"; 
      flags = ["--all"];
    };
    daemon.settings = {
      registry-mirrors = [ "https://registry.sysctl.io" ];
    };
  };

  environment.systemPackages = with pkgs; [ 
    docker-compose 
    ctop
  ];

  # Add the docker telegraf listener
  services.telegraf.extraConfig.inputs.docker = {};
  users.users.telegraf.extraGroups = [ "docker" ];
}