Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
104 lines
2.1 KiB
Nix
104 lines
2.1 KiB
Nix
{
|
|
stdenv,
|
|
makeBinaryWrapper,
|
|
removeReferencesTo,
|
|
srcOnly,
|
|
python3,
|
|
pnpm_9,
|
|
fetchFromGitHub,
|
|
nodejs,
|
|
vips,
|
|
pkg-config,
|
|
nixosTests,
|
|
lib,
|
|
nix-update-script,
|
|
}:
|
|
|
|
let
|
|
nodeSources = srcOnly nodejs;
|
|
pythonEnv = python3.withPackages (p: [ p.setuptools ]);
|
|
in
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "pds";
|
|
version = "0.4.182";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "bluesky-social";
|
|
repo = "pds";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-FNfM3kr0PTJp9mKYtzd6uH5mUfupqv0aA3sAPRq+pF4=";
|
|
};
|
|
|
|
sourceRoot = "${finalAttrs.src.name}/service";
|
|
|
|
nativeBuildInputs = [
|
|
makeBinaryWrapper
|
|
nodejs
|
|
pythonEnv
|
|
pkg-config
|
|
pnpm_9.configHook
|
|
removeReferencesTo
|
|
];
|
|
|
|
# Required for `sharp` NPM dependency
|
|
buildInputs = [ vips ];
|
|
|
|
pnpmDeps = pnpm_9.fetchDeps {
|
|
inherit (finalAttrs)
|
|
pname
|
|
version
|
|
src
|
|
sourceRoot
|
|
;
|
|
fetcherVersion = 2;
|
|
hash = "sha256-pUCICsuuc3CeWGeJ6il0etLQkntPF9MKRiJsiNDfroo=";
|
|
};
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
pushd ./node_modules/.pnpm/better-sqlite3@*/node_modules/better-sqlite3
|
|
npm run build-release --offline --nodedir="${nodeSources}"
|
|
find build -type f -exec remove-references-to -t "${nodeSources}" {} \;
|
|
popd
|
|
|
|
makeWrapper "${lib.getExe nodejs}" "$out/bin/pds" \
|
|
--add-flags --enable-source-maps \
|
|
--add-flags "$out/lib/pds/index.js" \
|
|
--set-default NODE_ENV production
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/{bin,lib/pds}
|
|
mv node_modules $out/lib/pds
|
|
mv index.js $out/lib/pds
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru = {
|
|
tests = lib.optionalAttrs stdenv.hostPlatform.isLinux { inherit (nixosTests) bluesky-pds; };
|
|
updateScript = nix-update-script { };
|
|
};
|
|
|
|
meta = {
|
|
description = "Bluesky Personal Data Server (PDS)";
|
|
homepage = "https://github.com/bluesky-social/pds";
|
|
license = with lib.licenses; [
|
|
mit
|
|
asl20
|
|
];
|
|
maintainers = with lib.maintainers; [
|
|
t4ccer
|
|
isabelroses
|
|
];
|
|
platforms = lib.platforms.unix;
|
|
mainProgram = "pds";
|
|
};
|
|
})
|