nix-community / authentik-nix

Nix flake with package, NixOS module and basic VM test for authentik. Trying to provide an alternative deployment mode to the officially supported docker-compose approach. Not affiliated with or officially supported by the authentik project [maintainer=@willibutz]
MIT License
74 stars 15 forks source link

Build error with latest nixos-unstable #24

Closed BonusPlay closed 2 months ago

BonusPlay commented 5 months ago

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 commented 5 months ago

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

WilliButz commented 5 months ago

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 commented 5 months ago

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.

MarcelCoding commented 4 months ago

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

WilliButz commented 4 months ago

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 commented 2 months ago

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.