Skip to content

nixos/keycloak: database isn't locally created when host set to a unix path #479508

@VlaDexa

Description

@VlaDexa

Nixpkgs version

  • Unstable (26.05)

Describe the bug

this doesn't account for instances when database is local and host is a unix socket

databaseActuallyCreateLocally = cfg.database.createLocally && cfg.database.host == "localhost";

Steps to reproduce

  services.keycloak = {
    enable = true;
    database.host = "/run/postgresql";
    plugins = with pkgs.keycloak.plugins; [
      junixsocket-common
      junixsocket-native-common
    ];
  ...
  };

Expected behaviour

for database to be created even if host is a unix socket

Screenshots

No response

Relevant log output

WARN  [io.agroal.pool] (agroal-11) Datasource '<default>': FATAL: role "keycloak" does not exist

Additional context

No response

System metadata

  • system: "x86_64-linux"
  • host os: Linux 6.12.63, NixOS, 26.05 (Yarara), 26.05.20260111.ffbc9f8
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.31.2+2
  • nixpkgs: /nix/store/ln4j1iqnnzs2ynx2cr88bdh65fmds2aq-source

Notify maintainers

@talyz @anish


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions