nixpkgs/pkgs/by-name/pi/pixelfed/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.2 KiB
Nix
Raw Normal View History

2022-09-13 16:42:12 +00:00
{ lib
, fetchFromGitHub
, php
2023-03-25 16:02:52 +00:00
, nixosTests
, nix-update-script
2022-09-13 16:42:12 +00:00
, dataDir ? "/var/lib/pixelfed"
, runtimeDir ? "/run/pixelfed"
}:
php.buildComposerProject (finalAttrs: {
2022-09-13 16:42:12 +00:00
pname = "pixelfed";
2024-07-05 17:46:55 +00:00
version = "0.12.3";
2022-09-13 16:42:12 +00:00
src = fetchFromGitHub {
owner = "pixelfed";
repo = "pixelfed";
rev = "v${finalAttrs.version}";
2024-07-05 17:46:55 +00:00
hash = "sha256-CKjqnxp7p2z/13zfp4HQ1OAmaoUtqBKS6HFm6TV8Jwg=";
2022-09-13 16:42:12 +00:00
};
2024-07-05 17:46:55 +00:00
vendorHash = "sha256-zjIjGkR9MCnjRho/ViqZ5EbS9MJ7OQ1kkg93jBssuZU=";
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-06-15 22:52:15 +00:00
passthru = {
tests = { inherit (nixosTests) pixelfed; };
updateScript = nix-update-script { };
2023-06-15 22:52:15 +00:00
};
2023-03-25 16:02:52 +00:00
2022-09-13 16:42:12 +00:00
meta = with lib; {
description = "Federated image sharing platform";
license = licenses.agpl3Only;
homepage = "https://pixelfed.org/";
maintainers = [ ];
2022-09-13 16:42:12 +00:00
platforms = php.meta.platforms;
};
})