authentik-nix/components/client-go.nix
Maximilian Bosch 9eed4f7e7e
update: 2025.12.1 -> 2025.12.3
Closes #90

ChangeLogs:
* https://github.com/goauthentik/authentik/releases/tag/version%2F2025.12.2
* https://github.com/goauthentik/authentik/releases/tag/version%2F2025.12.3

Using the `client-go` library that is vendored in this release's `go.mod`
breaks all outposts for me, so we're now doing what upstream is also
doing, i.e. generating the Go client code ourselves.
2026-02-07 16:52:28 +01:00

20 lines
502 B
Nix

{
authentik-src,
authentik-go,
openapi-generator-cli,
runCommand,
}:
runCommand "go-client-code" {
nativeBuildInputs = [
openapi-generator-cli
];
} ''
cp --no-preserve=mode -vr ${authentik-go}/ $out/
cp -vr ${authentik-src}/schema.yml $out/
pushd $out &>/dev/null
substituteInPlace config.yaml \
--replace-fail "templateDir: /local/templates/" "templateDir: ./templates/"
openapi-generator-cli generate -i schema.yml -g go -o . -c config.yaml
popd &>/dev/null
''