2024-06-25 04:04:39 +03:00
|
|
|
{ php, pkgs, util, config, ... } @args: let
|
2024-06-01 10:37:49 +03:00
|
|
|
cfg = pkgs.writeText "PrivateBinConfig" (import ./Config.nix args).text;
|
|
|
|
in php.buildComposerProject (finalAttrs: {
|
|
|
|
pname = "PrivateBin";
|
2024-08-21 11:33:31 +03:00
|
|
|
version = "1.7.4";
|
2024-06-01 10:37:49 +03:00
|
|
|
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "PrivateBin";
|
|
|
|
repo = "PrivateBin";
|
|
|
|
rev = finalAttrs.version;
|
2024-08-21 11:33:31 +03:00
|
|
|
hash = "sha256-RFP6rhzfBzTmqs4eJXv7LqdniWoeBJpQQ6fLdoGd5Fk=";
|
2024-06-01 10:37:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
vendorHash = "sha256-JGuO8kXLLXqq76EccdNSoHwYO5OuJT3Au1O2O2szAHI=";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mv $out/share/php/PrivateBin/* $out
|
|
|
|
rm -r $out/share
|
|
|
|
|
|
|
|
cp ${cfg} $out/cfg/conf.php
|
|
|
|
|
|
|
|
touch $out/.env
|
|
|
|
pushd $out
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
substituteInPlace $out/index.php --replace-fail \
|
|
|
|
"define('PATH', ''')" \
|
|
|
|
"define('PATH', '$out/')"
|
|
|
|
'';
|
|
|
|
})
|