mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 00:24:18 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
49 lines
1.2 KiB
Nix
49 lines
1.2 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, php
|
|
, nixosTests
|
|
, nix-update-script
|
|
, dataDir ? "/var/lib/pixelfed"
|
|
, runtimeDir ? "/run/pixelfed"
|
|
}:
|
|
|
|
php.buildComposerProject (finalAttrs: {
|
|
pname = "pixelfed";
|
|
version = "0.12.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "pixelfed";
|
|
repo = "pixelfed";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-CKjqnxp7p2z/13zfp4HQ1OAmaoUtqBKS6HFm6TV8Jwg=";
|
|
};
|
|
|
|
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
|
|
'';
|
|
|
|
passthru = {
|
|
tests = { inherit (nixosTests) pixelfed; };
|
|
updateScript = nix-update-script { };
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Federated image sharing platform";
|
|
license = licenses.agpl3Only;
|
|
homepage = "https://pixelfed.org/";
|
|
maintainers = [ ];
|
|
platforms = php.meta.platforms;
|
|
};
|
|
})
|