nix/nixos/common/services/podman.nix

34 lines
888 B
Nix
Raw Normal View History

2024-01-31 13:23:52 +09:00
{ inputs, pkgs, system, ... }: {
2023-12-18 19:26:37 +09:00
# 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;
};
2023-12-18 19:26:59 +09:00
2023-12-18 19:26:37 +09:00
virtualisation.podman = {
enable = true;
dockerSocket.enable = true;
2023-12-18 19:26:59 +09:00
dockerCompat = true;
2023-12-18 19:26:37 +09:00
autoPrune = {
2024-03-15 20:41:29 +09:00
enable = true;
dates = "weekly";
flags = [ "--all" ];
};
defaultNetwork.settings = {
dns_enabled = true;
2023-12-18 19:26:37 +09:00
};
};
environment.systemPackages = with pkgs; [
podman-compose
podman-tui
];
2024-03-14 09:53:52 +09:00
# Add the docker telegraf listener
2024-03-14 10:35:04 +09:00
services.telegraf.extraConfig.inputs.docker = {
2024-03-14 10:36:49 +09:00
endpoint = "unix://run/podman/podman.sock";
2024-03-14 10:35:04 +09:00
};
2024-03-14 10:23:28 +09:00
users.users.telegraf.extraGroups = [ "podman" ];
2023-12-18 22:20:48 +09:00
}