31 lines
859 B
Nix
31 lines
859 B
Nix
|
{ pkgs, src, version, ... }:
|
||
|
|
||
|
let
|
||
|
nodeComposition = import ./node-composition.nix { inherit pkgs; };
|
||
|
in
|
||
|
pkgs.runCommand "authentik-webui-${version}" {
|
||
|
inherit src;
|
||
|
nativeBuildInputs = [ nodeComposition.nodeDependencies ];
|
||
|
nodeDependencies = nodeComposition.nodeDependencies;
|
||
|
} ''
|
||
|
export PATH="$nodeDependencies/bin:$PATH"
|
||
|
|
||
|
mkdir $NIX_BUILD_TOP/src
|
||
|
cp -r $src/website $NIX_BUILD_TOP/src/website
|
||
|
cp -r $src/web $NIX_BUILD_TOP/src/web
|
||
|
chmod -R +w $NIX_BUILD_TOP/src
|
||
|
|
||
|
mkdir $out
|
||
|
|
||
|
cd $NIX_BUILD_TOP/src/web
|
||
|
ln -s $nodeDependencies/lib/node_modules ../node_modules
|
||
|
mkdir -p node_modules/@patternfly
|
||
|
cp -r ../node_modules/@patternfly/patternfly node_modules/@patternfly/patternfly
|
||
|
chmod -R +w node_modules/@patternfly/patternfly
|
||
|
|
||
|
lingui compile
|
||
|
rollup -c ./rollup.config.js
|
||
|
|
||
|
cp -r robots.txt security.txt dist/ authentik/ $out
|
||
|
''
|