1
0
Fork 0
forked from lukas/nixos-config
nixos-config/hosts/pinix/localServices/phanpy/package.nix
2026-07-28 20:26:06 +02:00

50 lines
1.1 KiB
Nix

{
lib,
buildNpmPackage,
fetchFromGitHub,
}:
# Build the customized Phanpy frontend as an immutable Nix store path.
buildNpmPackage {
pname = "phanpy";
version = "0.1.0-cd57e97";
src = fetchFromGitHub {
owner = "cheeaun";
repo = "phanpy";
rev = "cd57e97e2b708a29b9049c48a8da549594393c47";
hash = "sha256-kKWzklgTGlgy8bWVFGfTw1KzRXoO0HV5VKxLtV59jpY=";
};
patches = [
./0ff-space.patch
./local-only.patch
];
npmDepsHash = "sha256-LpvZfIzIdgxXg4upcDKm7jbK7CjrRvg//HULO4GDTdU=";
# Vite embeds these values into the static frontend during the build.
env = {
PHANPY_COMMIT_HASH = "cd57e97";
SOURCE_DATE_EPOCH = "1697649263";
VITE_CLIENT_NAME = "Phanpy";
VITE_WEBSITE = "https://phanpy.0ff.space";
};
# Install only the generated static site; build dependencies stay outside
# the runtime closure.
installPhase = ''
runHook preInstall
mkdir -p "$out"
cp -r dist/. "$out/"
runHook postInstall
'';
meta = {
description = "Minimalistic Mastodon web client customized for 0ff.space";
homepage = "https://github.com/cheeaun/phanpy";
license = lib.licenses.mit;
};
}