Configuring miniflux

I’m working through configuring miniflux on nixOS for the first time. Sharing my progress here in case someone’s done this before and knows the incantation already.

services = {
...
    postgresql = {
      enable = true;
      package = pkgs.postgresql_15;
      ensureDatabases = [ "miniflux" ];
      ensureUsers = [
        {
          name = "miniflux";
          ensurePermissions = {
            "DATABASE \"miniflux\"" = "ALL PRIVILEGES";
            "ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
          };
        }
      ];
      authentication = pkgs.lib.mkOverride 10 ''
        #type database  DBuser  auth-method
        local all       all     trust
      '';
    };

    miniflux = {
      enable = true;
      adminCredentialsFile = "/etc/miniflux.env";
      config = {
        LISTEN_ADDR = "127.0.0.1:8031";
        BASE_URL = "https://chespin.satstack.net:4431/";
        METRICS_COLLECTOR = "1";
      };
    };
  };

  system.stateVersion = "23.05";
}

Current result for miniflux.service is:

[FATAL] [Migration v1] pq: permission denied for schema public

configuration.nix

The miniflux service takes care of the database, no need to define it on your own.

1 Like

Appreciate the response, but it does l look like a database needs to exist before the miniflux-dbsetup.service runs:

systemd[1]: Starting Miniflux database setup...
..-miniflux-pre-start[39531]: psql: error: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: FATAL:  database "miniflux" does not exist

I just set up a Miniflux service myself on a NixOS machine that hat no PostgreSQL before.

I only added services.miniflux.* and things worked out-of-the box.

1 Like