authentik-nix/components/frontend.nix
WilliButz 608c5dd4f5
update: 2024.2.3 -> 2024.4.1
Release notes: https://docs.goauthentik.io/docs/releases/2024.4

Notable dependency updates:
python 3.11 -> python 3.12
golang 1.21 -> golang 1.22
nixpkgs-23.11 -> nixpkgs-unstable (for golang 1.22 until 24.05)

Introduces patch to `web/package-lock.json`, see `components/frontend.nix`,
this will cause IFD until the issue is resolved.
https://nixos.org/manual/nix/stable/language/import-from-derivation

Flake lock file updates:

• Updated input 'authentik-src':
    'github:goauthentik/authentik/6bb180f94ec124092c4f87ae5f5d892a70b32ff3' (2024-04-17)
  → 'github:goauthentik/authentik/ca70c963e55daf73b479a4513da06ac5cea77718' (2024-04-26)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/53a2c32bc66f5ae41a28d7a9a49d321172af621e' (2024-04-15)
  → 'github:NixOS/nixpkgs/6143fc5eeb9c4f00163267708e26191d1e918932' (2024-04-21)
• Updated input 'poetry2nix':
    'github:nix-community/poetry2nix/3c92540611f42d3fb2d0d084a6c694cd6544b609' (2024-02-22)
  → 'github:nix-community/poetry2nix/9245811b58905453033f1ef551f516cbee71c42c' (2024-04-26)
2024-04-27 20:59:27 +02:00

39 lines
1.1 KiB
Nix

{ authentik-src
, authentik-version
, authentikComponents
, buildNapalmPackage
, nodejs_21
, applyPatches
}:
let
patched-src = applyPatches {
src = authentik-src;
name = "patched-authentik-source";
patches = [
# Should be obsolete with the next release (i.e. 2024.4.2).
#
# The underlying issue was partially fixed by backporting https://github.com/goauthentik/authentik/pull/9419
# to 2024.4, but two deps are still missing the resolved/integrity fields in 2024.4.1
#
# (this introduces IFD)
./frontend-package-lock-json-missing-integrity-infos.patch
];
};
in
buildNapalmPackage "${patched-src}/web" rec {
version = authentik-version; # 0.0.0 specified upstream in package.json
NODE_ENV = "production";
nodejs = nodejs_21;
preBuild = ''
ln -sv ${authentikComponents.docs} ../website
'';
npmCommands = [
"npm install --include=dev --nodedir=${nodejs}/include/node --loglevel verbose --ignore-scripts"
"npm run build"
];
installPhase = ''
mkdir $out
mv dist $out/dist
cp -r authentik icons $out
'';
}