2024-07-27 06:49:29 +00:00
|
|
|
{ stdenv, nodejs, pnpm, fetchFromGitHub }:
|
2023-03-27 19:17:25 +00:00
|
|
|
|
|
|
|
let
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit (import ./sources.nix { inherit fetchFromGitHub; }) pname version src pnpmDepsHash;
|
2023-03-27 19:17:25 +00:00
|
|
|
in
|
2024-07-27 06:49:29 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2023-03-27 19:17:25 +00:00
|
|
|
pname = "${pname}-web";
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit src version;
|
2023-03-27 19:17:25 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
sourceRoot = "${finalAttrs.src.name}/web";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
nodejs
|
|
|
|
pnpm.configHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pnpmDeps = pnpm.fetchDeps {
|
|
|
|
inherit (finalAttrs) pname version src sourceRoot;
|
|
|
|
hash = pnpmDepsHash;
|
|
|
|
};
|
2023-03-27 19:17:25 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
substituteInPlace ./vite.config.ts \
|
|
|
|
--replace 'outDir: "../internal/server/public_html"' 'outDir: "dist"'
|
2023-03-27 19:17:25 +00:00
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
postBuild = ''
|
|
|
|
pnpm run build
|
|
|
|
'';
|
2023-03-27 19:17:25 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/share
|
|
|
|
mv dist $out/share/authelia-web
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2024-07-27 06:49:29 +00:00
|
|
|
})
|