authentik-nix/components/frontend.nix
Maximilian Bosch 3cf7092397
components/{docs,frontend}: use nodejs_24 again
We kept nodejs_22 in 6dc84faaec because of
a bug in NPM preventing us from upgrading[1]. This got solved in the
meantime and seems to have landed in a nodejs release (these usually
bundle NPM versions), so we can use the nodejs version that upstream
also uses again.

[1] https://github.com/npm/cli/issues/8541
2025-10-27 14:28:29 +01:00

29 lines
819 B
Nix

{
authentik-src,
authentik-version,
authentikComponents,
buildNapalmPackage,
nodejs_24,
}:
buildNapalmPackage "${authentik-src}/web" rec {
version = authentik-version; # 0.0.0 specified upstream in package.json
NODE_ENV = "production";
nodejs = nodejs_24;
preBuild = ''
ln -sv ${authentikComponents.docs} ../website
ln -sv ${authentik-src}/package.json ../
'';
# upstream does not clearly separate development dependencies
# from release build dependencies, therefore this workaround
CHROMEDRIVER_SKIP_DOWNLOAD = "true";
npmCommands = [
"npm install --include=dev --nodedir=${nodejs}/include/node --loglevel verbose --ignore-scripts"
"npm run build"
"npm run build:sfe"
];
installPhase = ''
mkdir $out
mv dist $out/dist
cp -r authentik icons $out
'';
}