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 - ''; - }; -}