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

24 lines
695 B
Nix
Raw Normal View History

2022-05-12 22:55:10 +00:00
{ pkgs, src, version, ... }:
let
nodeComposition = import ./node-composition.nix { inherit pkgs src; };
2022-05-12 22:55:10 +00:00
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
2022-05-12 22:55:10 +00:00
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
''