Move the build flag from the package to the module, that way everyone can just define their own URL in the module.
72 lines
1.4 KiB
Nix
72 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
fetchYarnDeps,
|
|
nodejs,
|
|
yarnConfigHook,
|
|
yarnBuildHook,
|
|
nix-update-script,
|
|
extraBuildEnv ? { },
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "ente-web-auth";
|
|
version = "4.3.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ente-io";
|
|
repo = "ente";
|
|
sparseCheckout = [ "auth" ];
|
|
tag = "auth-v${finalAttrs.version}";
|
|
fetchSubmodules = true;
|
|
hash = "sha256-/dWnaVll/kaKHTJ5gH18BR6JG5E6pF7/j+SgvE66b7M=";
|
|
};
|
|
sourceRoot = "${finalAttrs.src.name}/web";
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
yarnLock = "${finalAttrs.src}/web/yarn.lock";
|
|
hash = "sha256-Wu0/YHqkqzrmA5hpVk0CX/W1wJUh8uZSjABuc+DPxMA=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
yarnConfigHook
|
|
yarnBuildHook
|
|
nodejs
|
|
];
|
|
|
|
# See: https://github.com/ente-io/ente/blob/main/web/apps/photos/.env
|
|
env = extraBuildEnv;
|
|
|
|
buildPhase = ''
|
|
yarn build:auth
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
cp -r apps/auth/out $out
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru.updateScript = nix-update-script {
|
|
extraArgs = [
|
|
"--version-regex"
|
|
"auth-v(.*)"
|
|
];
|
|
};
|
|
|
|
meta = {
|
|
description = "Web client for Ente Auth";
|
|
homepage = "https://ente.io/";
|
|
changelog = "https://github.com/ente-io/ente/releases";
|
|
license = lib.licenses.agpl3Only;
|
|
maintainers = with lib.maintainers; [
|
|
surfaceflinger
|
|
pinpox
|
|
spaenny
|
|
];
|
|
platforms = lib.platforms.all;
|
|
};
|
|
})
|