2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, php
|
|
|
|
, nixosTests
|
2024-02-29 20:09:43 +00:00
|
|
|
, nix-update-script
|
2023-05-24 13:37:59 +00:00
|
|
|
, dataDir ? "/var/lib/pixelfed"
|
|
|
|
, runtimeDir ? "/run/pixelfed"
|
|
|
|
}:
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
php.buildComposerProject (finalAttrs: {
|
2023-05-24 13:37:59 +00:00
|
|
|
pname = "pixelfed";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.12.3";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pixelfed";
|
2024-07-27 06:49:29 +00:00
|
|
|
repo = "pixelfed";
|
2024-02-29 20:09:43 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-CKjqnxp7p2z/13zfp4HQ1OAmaoUtqBKS6HFm6TV8Jwg=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
vendorHash = "sha256-zjIjGkR9MCnjRho/ViqZ5EbS9MJ7OQ1kkg93jBssuZU=";
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv "$out/share/php/${finalAttrs.pname}"/* $out
|
|
|
|
rm -R $out/bootstrap/cache
|
|
|
|
# Move static contents for the NixOS module to pick it up, if needed.
|
|
|
|
mv $out/bootstrap $out/bootstrap-static
|
|
|
|
mv $out/storage $out/storage-static
|
|
|
|
ln -s ${dataDir}/.env $out/.env
|
|
|
|
ln -s ${dataDir}/storage $out/
|
|
|
|
ln -s ${dataDir}/storage/app/public $out/public/storage
|
|
|
|
ln -s ${runtimeDir} $out/bootstrap
|
|
|
|
chmod +x $out/artisan
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru = {
|
|
|
|
tests = { inherit (nixosTests) pixelfed; };
|
2024-02-29 20:09:43 +00:00
|
|
|
updateScript = nix-update-script { };
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Federated image sharing platform";
|
2023-05-24 13:37:59 +00:00
|
|
|
license = licenses.agpl3Only;
|
|
|
|
homepage = "https://pixelfed.org/";
|
|
|
|
maintainers = with maintainers; [ raitobezarius ];
|
|
|
|
platforms = php.meta.platforms;
|
|
|
|
};
|
2024-02-29 20:09:43 +00:00
|
|
|
})
|