From a0f445b0dd97349a6411c6e5cac3680c2a0c0322 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 7 Aug 2021 13:47:26 +0800 Subject: [PATCH] nixbld: remove old flarum files --- nixbld-etc-nixos/flarum-update.nix | 29 -------------- nixbld-etc-nixos/flarum.nix | 61 ------------------------------ 2 files changed, 90 deletions(-) delete mode 100644 nixbld-etc-nixos/flarum-update.nix delete mode 100644 nixbld-etc-nixos/flarum.nix diff --git a/nixbld-etc-nixos/flarum-update.nix b/nixbld-etc-nixos/flarum-update.nix deleted file mode 100644 index 0dff87b3..00000000 --- a/nixbld-etc-nixos/flarum-update.nix +++ /dev/null @@ -1,29 +0,0 @@ -# Run with: nix-shell flarum-update.nix - -{ pkgs ? import {} -}: - -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 - ''; -} diff --git a/nixbld-etc-nixos/flarum.nix b/nixbld-etc-nixos/flarum.nix deleted file mode 100644 index de7d9cf3..00000000 --- a/nixbld-etc-nixos/flarum.nix +++ /dev/null @@ -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 - ''; - }; -}