Start keycloak in `dev-mem` or `dev-file` mode either using `start-dev` or otherwise?

I have currently a PR open where I want to build keycloak such that it can use dev-mem and dev-file as db.

In the PR I build a new Nix derivation (basically builds keycloak with kc.sh build) with the config file I want. However dev-mem and dev-file are not available.

I cannot use start-dev to start keycloak, because that starts a build (apparently always, altough I already built it) and this does not work since the executable is in a non-writable location the /nix/store. So I want to use kc.sh start but to make dev-mem or dev-file I need to build a development build. Is that possible somehow? Or how can I force a build with using dev-mem or dev-file?

The respective derivation which builds keycloak in Nixpkgs is here: nixpkgs/pkgs/by-name/ke/keycloak/package.nix at nixos-unstable · NixOS/nixpkgs · GitHub

Thanks a lot.

Does anybody know how to build with kc.sh such that I get

When I try to do kc.sh build --profile=dev I get

 ERROR: You can not 'build' the server in development mode. Please re-build the server first, using 'kc.sh build' for the default production mode

So I am puzzled on how to do it?

It’s right there:

You can not ‘build’ the server in development mode

See Running Keycloak in a container - Keycloak

build is for building an optimized container for use with the start command