Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
39 lines
775 B
Nix
39 lines
775 B
Nix
{ stdenv, nodejs, pnpm, fetchFromGitHub }:
|
|
|
|
let
|
|
inherit (import ./sources.nix { inherit fetchFromGitHub; }) pname version src pnpmDepsHash;
|
|
in
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "${pname}-web";
|
|
inherit src version;
|
|
|
|
sourceRoot = "${finalAttrs.src.name}/web";
|
|
|
|
nativeBuildInputs = [
|
|
nodejs
|
|
pnpm.configHook
|
|
];
|
|
|
|
pnpmDeps = pnpm.fetchDeps {
|
|
inherit (finalAttrs) pname version src sourceRoot;
|
|
hash = pnpmDepsHash;
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace ./vite.config.ts \
|
|
--replace 'outDir: "../internal/server/public_html"' 'outDir: "dist"'
|
|
'';
|
|
|
|
postBuild = ''
|
|
pnpm run build
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/share
|
|
mv dist $out/share/authelia-web
|
|
|
|
runHook postInstall
|
|
'';
|
|
})
|