Error compiling lxml when upgrading to nixos 25.11 from 25.04

When upgrading to nixos 25.11 from 25.04, im getting this error, when authentik is upgrading:

error: Cannot build '/nix/store/gypmciaqhllx4qa4zkjm9ncnl00qwf8j-lxml-6.0.0.drv'.
       Reason: builder failed with exit code 2.
       Output paths:
         /nix/store/w4apg56rjc0v9kshgygf77ihdscs7srr-lxml-6.0.0
       Last 25 log lines:
       >       |                                                 |
       >       |                                                 xmlChar ** {aka unsigned char **}
       > src/lxml/etree.c:34529:82: note: expected ‘const xmlChar **’ {aka ‘const unsigned char **’} but argument is of type ‘xmlChar **’ {aka ‘unsigned char **’}
       > 34529 | static CYTHON_INLINE void __pyx_f_4lxml_5etree__fixThreadDictPtr(const xmlChar **__pyx_v_c_ptr, xmlDict *__pyx_v_c_src_dict, xmlDict *__pyx_v_c_dict) {
       >       |                                                                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
       > Compile failed: command '/nix/store/vr15iyyykg9zai6fpgvhcgyw7gckl78w-gcc-wrapper-14.3.0/bin/gcc' failed with exit code 1
       > cc -I/nix/store/www785flca9qwyacn033z0p18p8vp00l-libxml2-2.15.1-dev/include/libxml2 -I/nix/store/rhpjc99p0pxx9rbply1daykj63fq1lqx-libxslt-1.1.43-dev/include -I/usr/include/libxml2 -c /build/xmlXPathInit1yj85hp9.c -o build/xmlXPathInit1yj85hp9.o
       > /build/xmlXPathInit1yj85hp9.c: In function ‘main’:
       > /build/xmlXPathInit1yj85hp9.c:3:5: warning: ‘xmlXPathInit’ is deprecated: See https://gnome.pages.gitlab.gnome.org/libxml2/html/deprecated.html [-Wdeprecated-declarations]
       >     3 |     xmlXPathInit();
       >       |     ^~~~~~~~~~~~
       > In file included from /build/xmlXPathInit1yj85hp9.c:1:
       > /nix/store/www785flca9qwyacn033z0p18p8vp00l-libxml2-2.15.1-dev/include/libxml2/libxml/xpath.h:561:21: note: declared here
       >   561 |                     xmlXPathInit                (void);
       >       |                     ^~~~~~~~~~~~
       > cc build/xmlXPathInit1yj85hp9.o -L/nix/store/jcr97i4l3gqxyy6x3rb5yjwwxhi4454l-libxml2-2.15.1/lib -L/nix/store/075b6j43x9hvl1d565xgicgdjkd4qw3m-libxslt-1.1.43/lib -lxml2 -o a.out
       > error: command '/nix/store/vr15iyyykg9zai6fpgvhcgyw7gckl78w-gcc-wrapper-14.3.0/bin/gcc' failed with exit code 1
       > DEBUG Released lock at `/build/uv-setuptools-5c51e56cef7f4ba1.lock`
       >   x Failed to build `/build/lxml-6.0.0`
       >   |-> The build backend returned an error
       >   `-> Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit
       >       status: 1)
       >       hint: This usually indicates a problem with the package or the build
       >       environment.
       > DEBUG Released lock at `/build/.tmpjlrvTh/.lock`
       For full logs, run:
         nix log /nix/store/gypmciaqhllx4qa4zkjm9ncnl00qwf8j-lxml-6.0.0.drv
error: Cannot build '/nix/store/6chw0955gkxjkaqbdans9qamgs3hby45-authentik-env.drv'.
       Reason: 1 dependency failed.
       Output paths:

         /nix/store/97hslpkimync7fa46vkskf89ngpidw8n-authentik-env
error: Cannot build '/nix/store/0213d8jlzzr7821w2niqw5smbi8w3i2f-authentik-gopkgs-2025.8.2.drv'.
{
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/l5cglrqsi9d47ngbb0g26hkw0dbl19vj-authentik-gopkgs-2025.8.2
error: Cannot build '/nix/store/bx0a42wgv70g5mmak5f4ai9403m6jxn5-authentik-manage.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/mjyb1hryfs5vjq8wcdz9if5dvpqqpr7a-authentik-manage
error: Cannot build '/nix/store/87wpfsq8djcsdvhysnd77pggnwaplqqv-authentik-migrate.py.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/xiv8d3ia5ps35yjmsfb18f13fgkpns3p-authentik-migrate.py
error: Cannot build '/nix/store/6np9lqpzlfamxc94v9d1jgq3ylp0q5cf-ak.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/bcwmfcab7fp9c4kd7kncfdj7bfka9qx1-ak
error: Cannot build '/nix/store/j8v67zpyywxladhh10lqsfhiqywmnl0y-unit-authentik-migrate.service.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/cyfnj96qyks9qr5rzd3lna8fzfxdcr1r-unit-authentik-migrate.service
error: Cannot build '/nix/store/n7vrlvixclirk4b244i77nybdcfpfwwy-system-path.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/2zq7qn6bg0nv17ypzqz3m9z3rm456s9g-system-path
error: Cannot build '/nix/store/515ql14v0czmqdgc5l1lq4lz559fg2v0-nixos-system-vm-apps-02-25.11.20251209.09eb77e.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/v1dwxq01kxzf3a85zc2ljai1xv40dpbx-nixos-system-vm-apps-02-25.11.20251209.09eb77e
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '/etc/nixos#nixosConfigurations."vm-apps-02".config.system.build.toplevel' --no-link' returned non-zero exit status 

Someone can guide me on how to upgrade this correctly? I see that error that it’s patched in lxml 6.0.2 but i don’t get how to apply that version in the upgrade, or what to do.

PS: I have authentik, the problematic package, installed with flake:

# flake.nix

{
  description = "My NixOS Flake";

  inputs = {
    
    #nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";

    sops-nix = {
      url = "github:Mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    home-manager = {
      url = "github:nix-community/home-manager/release-25.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    authentik-nix = {
      url = "github:nix-community/authentik-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };

  };

  outputs = { self, nixpkgs, home-manager, sops-nix, ... } @inputs: {

    nixosConfigurations.vm-apps-02 = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      specialArgs = { inherit inputs; };
      modules = [
        ./configuration.nix
        sops-nix.nixosModules.sops
        home-manager.nixosModules.home-manager
        {
          home-manager.useGlobalPkgs = true;
          home-manager.useUserPackages = true;
          home-manager.users.XXX = import ./home-XXX.nix;
        }
        inputs.authentik-nix.nixosModules.default
      ];
    };
  };
}