anchor.diff:          '';
         };
   
  +      python = {
  +        enable = mkOption {
  +          type = types.bool;
  +          default = true;
  +          description = ''
  +            Whether to enable python-based plugins
  +          '';
  +        };
  +        extraPackages = mkOption {
  +          default = ps: [];
  +          defaultText = "ps: []";
  +          example = literalExample ''
  +            ps: [
  +              ps.psycopg2
  +              ps.docker
  +              ps.dnspython
  +            ]
  +          '';
  +          description = ''
  +            Extra python packages available at runtime
  +            to enable additional python plugins.
  +          '';
  +        };
  +      };
  +
         config = mkOption {
           type = types.attrsOf types.attrs;
           default = {};
  
positive.code:       serviceConfig = {
          User = cfg.user;
          Group = cfg.group;
          PermissionsStartOnly = true;
          ExecStart = "${pkgs.netdata}/bin/netdata -D -c ${configFile}";
          TimeoutStopSec = 60;
  
negative.code:         }
        ];
      systemd.services.netdata = {
        description = "Real time performance monitoring";
        after = [ "network.target" ];
        wantedBy = [ "multi-user.target" ];
        path = (with pkgs; [ gawk curl ]) ++ lib.optional cfg.python.enable
          (pkgs.python3.withPackages cfg.python.extraPackages);
        preStart = concatStringsSep "\n" (map (dir: ''
          mkdir -vp ${dir}
          chmod 750 ${dir}
  