depot/nix/pkgs/authentik/webui/default.nix

31 lines
863 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-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
''