30 lines
636 B
Nix
30 lines
636 B
Nix
|
# Run with: nix-shell flarum-update.nix
|
||
|
|
||
|
{ pkgs ? import <nixpkgs> {}
|
||
|
}:
|
||
|
|
||
|
with pkgs;
|
||
|
let
|
||
|
composer2nix = import (fetchFromGitHub {
|
||
|
owner = "svanderburg";
|
||
|
repo = "composer2nix";
|
||
|
rev = "v0.0.4";
|
||
|
sha256 = "0q0x3in43ss1p0drhc5lp5bnp2jqni1i7zxm7lmjl5aad9nkn3gf";
|
||
|
}) { inherit pkgs; };
|
||
|
in
|
||
|
stdenv.mkDerivation {
|
||
|
name = "flarum-update";
|
||
|
buildInputs = [ phpPackages.composer composer2nix ];
|
||
|
shellHook = ''
|
||
|
OUT=$(pwd)/flarum
|
||
|
|
||
|
cd $(mktemp -d)
|
||
|
composer create-project flarum/flarum . --stability=beta
|
||
|
composer require fof/upload
|
||
|
|
||
|
composer2nix
|
||
|
cp -v *.nix composer.{json,lock} $OUT/
|
||
|
exit
|
||
|
'';
|
||
|
}
|