nix/nixos/common/services/docker.nix
2024-03-22 13:37:04 +09:00

25 lines
657 B
Nix

{ inputs, pkgs, system, ... }: {
boot.kernel.sysctl = {
"fs.inotify.max_user_watches" = 10485760;
"fs.inotify.max_user_instances" = 1024;
};
virtualisation.docker = {
enable = true;
enableOnBoot = true;
autoPrune.enable = true;
autoPrune.dates = "weekly";
liveRestore = true;
};
environment.systemPackages = with pkgs; [
docker-compose
ctop
lazydocker
inputs.compose2nix.packages.${system}.default
];
# Add the docker telegraf listener
services.telegraf.extraConfig.inputs.docker = {};
users.users.telegraf.extraGroups = [ "docker" ];
}