nix/nixos/common/services/podman.nix
2024-03-15 20:41:29 +09:00

34 lines
940 B
Nix

{ inputs, pkgs, system, ... }: {
# 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" = 10485760;
"fs.inotify.max_user_instances" = 1024;
};
virtualisation.podman = {
enable = true;
dockerSocket.enable = true;
dockerCompat = true;
autoPrune = {
enable = true;
dates = "weekly";
flags = [ "--all" ];
};
defaultNetwork.settings = {
dns_enabled = true;
};
};
environment.systemPackages = with pkgs; [
podman-compose
podman-tui
inputs.compose2nix.packages.${system}.default
];
# Add the docker telegraf listener
services.telegraf.extraConfig.inputs.docker = {
endpoint = "unix://run/podman/podman.sock";
};
users.users.telegraf.extraGroups = [ "podman" ];
}