nixpkgs/pkgs/servers/authelia/web.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
775 B
Nix
Raw Normal View History

2024-03-27 16:42:29 +00:00
{ stdenv, nodejs, pnpm, fetchFromGitHub }:
let
2024-03-27 16:42:29 +00:00
inherit (import ./sources.nix { inherit fetchFromGitHub; }) pname version src pnpmDepsHash;
in
2024-03-27 16:42:29 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "${pname}-web";
2024-03-27 16:42:29 +00:00
inherit src version;
2024-03-27 16:42:29 +00:00
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"'
'';
2024-03-27 16:42:29 +00:00
postBuild = ''
pnpm run build
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share
mv dist $out/share/authelia-web
runHook postInstall
'';
2024-03-27 16:42:29 +00:00
})