authentik-nix icon indicating copy to clipboard operation
authentik-nix copied to clipboard

Build error with latest nixos-unstable

Open BonusPlay opened this issue 1 year ago • 3 comments

When attempting to build current main branch under current nixos-unstable I get the following error

error: evaluation aborted with the following error message: 'lib.customisation.callPackageWith: Function called without required argument "nodejs_21" at /nix/store/qs161vzi5kh527nyhfpjldkcshgh790y-source/components/frontend.nix:5, did you mean "nodejs_20", "nodejs_22" or "nodejs_14"?'

nodejs_21 was dropped recently (https://github.com/NixOS/nixpkgs/commit/12c19fa317f73b5aea5e32f60e2cd00222e2e831). The fix should nicely tie-in with #18.

BonusPlay avatar Apr 27 '24 21:04 BonusPlay

I can confirm that it builds and runs just fine with nodejs_22.

BonusPlay avatar Apr 28 '24 08:04 BonusPlay

Hmm I see. It's a bit unfortunate that 21 was already removed from nixpkgs before reaching EOL. I suppose the intention was to not have it in 24.05. Anyways, I'm sure that upstream authentik will upgrade soon as well. Until that makes it to a release, I'll provide a separate branch which uses the LTS version 22, so that it can be used when overriding this flake's nixpkgs input to a more recent revision.

WilliButz avatar Apr 28 '24 10:04 WilliButz

It should be sufficient to run something like

nix flake lock --update-input authentik-nix --override-input authentik-nix github:nix-community/authentik-nix/node-22

for your flake, depending on how your authentik-nix flake input is called.

I'll close this issue when an authentik release with nodejs 22 is published and packaged here on main.

WilliButz avatar Apr 28 '24 11:04 WilliButz

Authentik itself builds against Node.js 20: https://docs.goauthentik.io/developer-docs/setup/frontend-dev-environment

MarcelCoding avatar Jun 07 '24 09:06 MarcelCoding

Authentik itself builds against Node.js 20: https://docs.goauthentik.io/developer-docs/setup/frontend-dev-environment

No it does not, the docs seem to be out of date. The latest released version uses node 21, see https://github.com/goauthentik/authentik/blob/version/2024.4.2/Dockerfile#L4 Current main uses node 22.

So I'll refer to using https://github.com/nix-community/authentik-nix/issues/24#issuecomment-2081434880 until the next release is published with node 22.

WilliButz avatar Jun 07 '24 11:06 WilliButz

Now with the 2024.6 releases the node-22 workaround should no longer be necessary and the main branch can be used again.

I'll delete the node-22 branch, so that people (hopefully) get an error when they try to fetch it. Should someone still want to have that for whatever reason, a copy of that branch named "old/node-22" will remain.

WilliButz avatar Jul 12 '24 10:07 WilliButz