nixos-config/pkgs/pdsadmin/default.nix

63 lines
1.1 KiB
Nix
Raw Permalink Normal View History

2024-12-03 20:02:13 +01:00
{
stdenvNoCC,
bash,
pds,
makeBinaryWrapper,
jq,
curl,
openssl,
lib,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "pdsadmin";
inherit (pds) version src;
patches = [ ./pdsadmin-offline.patch ];
2024-12-19 22:54:57 +01:00
nativeBuildInputs = [
makeBinaryWrapper
];
2024-12-03 20:02:13 +01:00
buildInputs = [
bash
];
2024-12-19 22:54:57 +01:00
strictDeps = true;
2024-12-03 20:02:13 +01:00
buildPhase = ''
runHook preBuild
substituteInPlace pdsadmin.sh \
--replace-fail NIXPKGS_PDSADMIN_ROOT $out
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib/pds
install -Dm755 pdsadmin.sh $out/lib/pds/
install -Dm755 pdsadmin/*.sh $out/lib/pds/
makeBinaryWrapper "$out/lib/pds/pdsadmin.sh" "$out/bin/pdsadmin" \
--prefix PATH : "${
lib.makeBinPath [
jq
curl
openssl
]
}"
runHook postInstall
'';
meta = {
description = "Admin scripts for Bluesky Personal Data Server (PDS)";
inherit (pds.meta) homepage license;
maintainers = with lib.maintainers; [ t4ccer ];
platforms = lib.platforms.unix;
mainProgram = "pdsadmin";
};
})