anchor.diff:        ];
       };
   
  -    services.postgresql = optionalAttrs (cfg.database.type == "pgsql") {
  +    services.postgresql = mkIf pgsqlLocal {
         enable = mkDefault true;
  +      ensureDatabases = [ cfg.database.name ];
  +      ensureUsers = [
  +        { name = cfg.user;
  +          ensurePermissions = { "DATABASE ${cfg.database.name}" = "ALL PRIVILEGES"; };
  +        }
  +      ];
       };
   
  -    users = optionalAttrs (cfg.user == "tt_rss") {
  -      users.tt_rss = {
  -        description = "tt-rss service user";
  -        isSystemUser = true;
  -        group = "tt_rss";
  -      };
  -      groups.tt_rss = {};
  +    users.users.tt_rss = optionalAttrs (cfg.user == "tt_rss") {
  +      description = "tt-rss service user";
  +      isSystemUser = true;
  +      group = "tt_rss";
       };
  +
  +    users.groups.tt_rss = {};
     };
   }
  
positive.code: 
          serviceConfig = {
            User = "${cfg.user}";
            ExecStart = "${pkgs.php}/bin/php ${cfg.root}/update.php --daemon";
            StandardOutput = "syslog";
            StandardError = "syslog";
            PermissionsStartOnly = true;
          };
  
          wantedBy = [ "multi-user.target" ];
          requires = ["${dbService}"];
          after = ["network.target" "${dbService}"];
      };
  
      services.mysql = optionalAttrs (cfg.database.type == "mysql") {
        enable = true;
        package = mkDefault pkgs.mysql;
        ensureDatabases = [ cfg.database.name ];
  
negative.code:       };
      };
  
      systemd.tmpfiles.rules = [
        "d '${cfg.root}' 0755 ${cfg.user} tt_rss - -"
        "Z '${cfg.root}' 0755 ${cfg.user} tt_rss - -"
      ];
  
      systemd.services.tt-rss =
        {
  
          description = "Tiny Tiny RSS feeds update daemon";
  
  