This document describes how to use the nix-shell environment for local development.
To enter the nix-shell environment:
nix-shell nix/shell.nixThis will provide:
- Node.js and npm for building the theme
- Docker and docker-compose for running services
Once inside the nix-shell, start the keycloak and postgres services:
docker compose upThe services will:
- Start postgres on the default port
- Start keycloak on port 8080
- Import realms from
keycloak/import/ - Mount the theme jar from
dist_keycloak/
To build the theme jar locally:
npm ci
npm run build-keycloak-themeThis will generate the jar files in dist_keycloak/.
If you want to use a jar from a GitHub release instead of building locally, you can:
- Download the jar from the GitHub release
- Place it in
dist_keycloak/askeycloak-theme-for-kc-all-other-versions.jar - Update
docker-compose.ymlif the jar name differs
Alternatively, you can modify nix/shell.nix to fetch the jar automatically using pkgs.fetchurl:
themeJar = pkgs.fetchurl {
url = "https://github.com/helpwave/id.helpwave.de/releases/download/v0.1.0/keycloak-theme-for-kc-all-other-versions.jar";
sha256 = "0000000000000000000000000000000000000000000000000000000000000000";
};Replace the sha256 with the actual hash of the jar file.
To update the jar reference for a new release:
- Update the
urlin thefetchurlcall to point to the new release - Update the
sha256hash to match the new jar file - Rebuild the nix-shell environment
You can get the SHA256 hash using:
nix-prefetch-url <jar-url>