depot/nix/pkgs/authentik/docs/default.nix

23 lines
695 B
Nix

{ pkgs, src, version, ... }:
let
nodeComposition = import ./node-composition.nix { inherit pkgs src; };
in
pkgs.runCommand "authentik-docs-${version}" {
inherit src;
nativeBuildInputs = [ nodeComposition.nodeDependencies ];
nodeDependencies = nodeComposition.nodeDependencies;
} ''
export PATH="$nodeDependencies/bin:$PATH"
cp -r $src/website $NIX_BUILD_TOP/website
cp -r $src/blueprints $NIX_BUILD_TOP/blueprints
chmod -R +w $NIX_BUILD_TOP/website $NIX_BUILD_TOP/blueprints
cd $NIX_BUILD_TOP/website
ln -s $nodeDependencies/lib/node_modules ./node_modules
docusaurus build --config docusaurus.docs-only.js --out-dir $NIX_BUILD_TOP/out
mv $NIX_BUILD_TOP/out $out
''