blumeops/containers/authentik/test-build.nix
Erich Blume efa9806bfa
All checks were successful
Build Container / detect (push) Successful in 3s
Build Container (Nix) / detect (push) Successful in 1s
Build Container / build (authentik) (push) Successful in 2s
Build Container (Nix) / build (authentik) (push) Successful in 22s
C2: Build authentik from source (Mikado chain) (#274)
## Mikado Chain: build-authentik-from-source

Replace `pkgs.authentik` from nixpkgs with a custom Nix derivation built from source.
This removes the dependency on the nixpkgs packaging timeline and gives full version control.

Target version: **2025.12.4** (nixpkgs reference, upgrading from deployed 2025.10.1).

### Dependency Graph

```
build-authentik-from-source (goal)
├── authentik-go-server-derivation
│   ├── authentik-api-client-generation  ← IN PROGRESS
│   └── authentik-python-backend-derivation
├── authentik-web-ui-derivation
│   └── authentik-api-client-generation  ← IN PROGRESS
└── authentik-python-backend-derivation
```

### Ready Leaves
- `authentik-api-client-generation` — Go + TypeScript client generation from OpenAPI schema
- `authentik-python-backend-derivation` — Django backend with 60+ deps, 4 in-tree packages

### Architecture
Ported from [nixpkgs `pkgs/by-name/au/authentik/package.nix`](https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/au/authentik):
- `source.nix` — shared version/source fetch
- `client-go.nix` — Go API client generation
- `client-ts.nix` — TypeScript API client generation
- `api-go-vendor-hook.nix` — Go vendor directory injection hook
- (more components to follow as leaves are closed)

### Related Cards
- [[build-authentik-from-source]] — Goal card
- [[authentik-api-client-generation]]
- [[authentik-python-backend-derivation]]
- [[authentik-web-ui-derivation]]
- [[authentik-go-server-derivation]]

Reviewed-on: https://forge.ops.eblu.me/eblume/blumeops/pulls/274
2026-03-01 13:45:00 -08:00

44 lines
2.3 KiB
Nix

# Test harness for building authentik components on ringtail
# Uses builtins.getFlake instead of <nixpkgs> (ringtail has flakes, no NIX_PATH)
#
# Usage:
# nix-build test-build.nix -A python-deps --extra-experimental-features 'nix-command flakes'
# nix-build test-build.nix -A authentik-django --extra-experimental-features 'nix-command flakes'
# nix-build test-build.nix -A client-go --extra-experimental-features 'nix-command flakes'
# nix-build test-build.nix -A client-ts --extra-experimental-features 'nix-command flakes'
# nix-build test-build.nix -A authentik-server --extra-experimental-features 'nix-command flakes'
# nix-build test-build.nix -A webui-deps --extra-experimental-features 'nix-command flakes'
# nix-build test-build.nix -A webui --extra-experimental-features 'nix-command flakes'
# nix-build test-build.nix -A assembled --extra-experimental-features 'nix-command flakes'
let
pkgs = (builtins.getFlake "nixpkgs").legacyPackages.x86_64-linux;
sources = import ./sources.nix { inherit pkgs; };
# Individual components (isolated, no cross-wiring)
_webui = import ./webui.nix { inherit pkgs sources; };
# Fully wired assembly (webui → authentik-django → authentik-server)
_authentik-django-assembled = import ./authentik-django.nix { inherit pkgs sources; webui = _webui; };
_authentik-server-assembled = import ./authentik-server.nix {
inherit pkgs sources;
authentik-django = _authentik-django-assembled;
webui = _webui;
};
in
{
# Individual component builds (for debugging in isolation)
python-deps = import ./python-deps.nix { inherit pkgs sources; };
authentik-django = import ./authentik-django.nix { inherit pkgs sources; };
client-go = import ./client-go.nix { inherit pkgs sources; };
client-ts = import ./client-ts.nix { inherit pkgs sources; };
authentik-server = import ./authentik-server.nix { inherit pkgs sources; };
webui-deps = import ./webui-deps.nix { inherit pkgs sources; };
webui = _webui;
# Fully assembled stack — tests that all components wire together
assembled = pkgs.linkFarm "authentik-assembled-${sources.version}" [
{ name = "authentik-django"; path = _authentik-django-assembled; }
{ name = "authentik-server"; path = _authentik-server-assembled; }
{ name = "webui"; path = _webui; }
];
}