Skip to content

Instantly share code, notes, and snippets.

@noflcl
Last active February 19, 2025 15:42
Show Gist options
  • Select an option

  • Save noflcl/b39cc5b17e31ce5ae08d147ee72f7703 to your computer and use it in GitHub Desktop.

Select an option

Save noflcl/b39cc5b17e31ce5ae08d147ee72f7703 to your computer and use it in GitHub Desktop.
PiHole V6 podman container using Nix oci-containers

PiHole V6

Are you using Nix? Have you been using oci-containers turing your Docker compose files into systemd podman services?

Probably should check it out, it's sweet!

Note: You must create your mapped volumes locally before the container will start.

Since they have dropped .php the new dashboard URL is http's'://server-ip/admin/login

  virtualisation = {
    containers.enable = true;
    podman.enable = true;

    oci-containers.containers = {
      "pihole" = {
        autoStart = true;
        image = "pihole/pihole:latest";
        environment = {
          TZ = "America/Edmonton";
          FTLCONF_webserver_api_password = "changeme";
          FTLCONF_dns_listeningMode = "all";
        };
        ports = [
          "53:53/udp"
          "53:53/tcp"
          "80:80/tcp"
          "443:443/tcp"
        ];
        volumes = [
          "/pihole/data:/etc/pihole"
        ];
        # Add if using DHCP server
        # extraOptions are passed to podman run as command line parameters
        #extraOptions = [
        #  "--cap-add=NET_ADMIN"
        #];
      };
    };
  };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment