Skip to content

Commit

Permalink
Copied structure from pixelfed https://github.com/NixOS/nixpkgs/tree/…
Browse files Browse the repository at this point in the history
  • Loading branch information
albertchae committed Jul 24, 2023
1 parent 65fa58e commit fb7aac9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 11 deletions.
File renamed without changes.
55 changes: 46 additions & 9 deletions pkgs/flarum/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,52 @@
{ pkgs }:
{ lib
, stdenv
, fetchFromGitHub
, php
, pkgs
, nixosTests
, dataDir ? "/var/lib/flarum"
, runtimeDir ? "/run/falrum"
}:

{
src = builtins.fetchFromGitHub {
let
package = (import ./composition.nix {
inherit pkgs;
inherit (stdenv.hostPlatform) system;
noDev = true; # Disable development dependencies
}).overrideAttrs (attrs : {
installPhase = attrs.installPhase + ''
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
'';
});
in package.override rec {
pname = "flarum";
version = "1.8.0";

src = fetchFromGitHub {
owner = "flarum";
repo = "flarum";
rev = "v1.8.0";
sha256 = "";
repo = pname;
rev = "v${version}";
hash = "";
};

dependencies = pkgs.lib.makeOverridable (import ./dependencies) {
inherit pkgs;
noDev = true;
passthru = {
tests = { inherit (nixosTests) pixelfed; };
updateScript = ./update.sh;
};

meta = with lib; {
description = "A federated image sharing platform";
license = licenses.agpl3Only;
homepage = "https://pixelfed.org/";
maintainers = with maintainers; [ raitobezarius ];
platforms = php.meta.platforms;
};
}
4 changes: 2 additions & 2 deletions pkgs/flarum/php-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,8 @@ in
composerEnv.buildPackage {
inherit packages devPackages noDev;
name = "flarum-flarum";
# src = composerEnv.filterSrc ./.;
src = ./src;
src = composerEnv.filterSrc ./.;
# src = ./src;
executable = false;
symlinkDependencies = false;
meta = {
Expand Down

0 comments on commit fb7aac9

Please sign in to comment.