From 43e8db61197f8df838e97deb71201d8d38b9c01c Mon Sep 17 00:00:00 2001 From: albert <albert@sysctl.io> Date: Mon, 24 Feb 2025 13:26:23 -0800 Subject: [PATCH] Update podman.nix --- nixos/common/services/docker.nix | 5 +-- nixos/common/services/podman.nix | 68 ++++++++++++++++---------------- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/nixos/common/services/docker.nix b/nixos/common/services/docker.nix index 3594a51e..57437cd4 100644 --- a/nixos/common/services/docker.nix +++ b/nixos/common/services/docker.nix @@ -1,11 +1,10 @@ { 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; - # Testing... - # "net.core.netdev_max_backlog" = 4000; - # "net.ipv4.tcp_max_syn_backlog" = 4096; }; # Allow Docker containers to access Tailscale network diff --git a/nixos/common/services/podman.nix b/nixos/common/services/podman.nix index dc7d6d52..1517e00b 100644 --- a/nixos/common/services/podman.nix +++ b/nixos/common/services/podman.nix @@ -1,39 +1,39 @@ -{ 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; - }; - - # Allow Docker containers to access Tailscale network - networking.firewall = { - trustedInterfaces = [ "tailscale0" ]; - allowedUDPPorts = [ 41641 ]; # Tailscale port +{ 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" = 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; - }; - }; + # Allow Podman containers to access Tailscale network + networking.firewall = { + trustedInterfaces = [ "tailscale0" ]; + allowedUDPPorts = [ 41641 ]; # Tailscale port + }; - environment.systemPackages = with pkgs; [ - podman-compose - podman-tui - ]; - - # Add the docker telegraf listener - services.telegraf.extraConfig.inputs.docker = { - endpoint = "unix://run/podman/podman.sock"; + virtualisation.podman = { + enable = true; + dockerSocket.enable = true; + dockerCompat = true; + autoPrune = { + enable = true; + dates = "weekly"; + flags = [ "--all" ]; }; - users.users.telegraf.extraGroups = [ "podman" ]; + defaultNetwork.settings = { + dns_enabled = true; + }; + }; + + environment.systemPackages = with pkgs; [ + podman-compose + podman-tui + ]; + + # Add the docker telegraf listener + services.telegraf.extraConfig.inputs.docker = { + endpoint = "unix://run/podman/podman.sock"; + }; + users.users.telegraf.extraGroups = [ "podman" ]; }