forked from M-Labs/it-infra
nixbld: remove old flarum files
This commit is contained in:
parent
9474dfa3a2
commit
a0f445b0dd
|
@ -1,29 +0,0 @@
|
|||
# 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
|
||||
'';
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
flarumPackage = with pkgs; stdenv.mkDerivation {
|
||||
name = "flarum-package";
|
||||
src = fetchFromGitHub {
|
||||
owner = "flarum";
|
||||
repo = "flarum";
|
||||
rev = "v0.1.0-beta.13";
|
||||
sha256 = "0mj6w7nibdqmi7lx2r5d9yiif6lb584l93551i115a9ly3s4yinn";
|
||||
};
|
||||
buildPhase =
|
||||
''
|
||||
cp ${./flarum}/* .
|
||||
'';
|
||||
installPhase =
|
||||
''
|
||||
cp -ar . $out
|
||||
'';
|
||||
};
|
||||
flarum = import "${flarumPackage}" {
|
||||
inherit pkgs;
|
||||
noDev = true;
|
||||
};
|
||||
cfg = config.services.flarum;
|
||||
in
|
||||
{
|
||||
options.services.flarum = with pkgs.lib; {
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "nobody";
|
||||
};
|
||||
group = mkOption {
|
||||
type = types.str;
|
||||
default = "nogroup";
|
||||
};
|
||||
installPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/var/www/flarum";
|
||||
};
|
||||
};
|
||||
|
||||
config.systemd.services.flarum-install = {
|
||||
description = "Flarum installation";
|
||||
before = [ "nginx.service" "phpfm-flarum.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
};
|
||||
path = [ pkgs.rsync ];
|
||||
script = with cfg; ''
|
||||
mkdir -p ${installPath}
|
||||
rsync --links --recursive ${flarum}/ ${installPath}
|
||||
for d in ${installPath} ${installPath}/public/assets \
|
||||
${installPath}/storage ${installPath}/storage/*
|
||||
do
|
||||
chown ${user}:${group} $d
|
||||
chmod 0775 $d
|
||||
done
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue