From 2e99f366c08f99be4a879fe0ffe35633821e6930 Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Fri, 14 Aug 2020 15:42:11 +0200 Subject: [PATCH] matrix presents --- default.nix | 1 + pkgs/matrix-presents/default.nix | 38 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 pkgs/matrix-presents/default.nix diff --git a/default.nix b/default.nix index ba1facd..adbf5ea 100644 --- a/default.nix +++ b/default.nix @@ -21,6 +21,7 @@ in eplot = pkgs.callPackage ./pkgs/eplot { }; synapse-admin = pkgs.callPackage ./pkgs/synapse-admin { }; +# matrix-presents = pkgs.callPackage ./pkgs/matrix-presents { }; matrix-wug = pkgs.callPackage ./pkgs/matrix-wug { }; rust-synapse-compress-state = pkgs.callPackage ./pkgs/rust-synapse-compress-state { }; diff --git a/pkgs/matrix-presents/default.nix b/pkgs/matrix-presents/default.nix new file mode 100644 index 0000000..72dfe2d --- /dev/null +++ b/pkgs/matrix-presents/default.nix @@ -0,0 +1,38 @@ +{ lib, writeText, mkYarnPackage, fetchFromGitHub, nodejs-12_x, jq, conf ? {} }: + +let + defaultConfig = { + guest_homeserver = "https://reckless.half-shot.uk"; + base_url = "https://presents.half-shot.uk"; + }; + configOverrideFile = writeText "matri-presents-config-overrides.json" (builtins.toJSON (defaultConfig // conf)); +in +mkYarnPackage { + pname = "matrix-presents"; + version = "unstable-2020-03-04"; + + #src = fetchFromGitHub { + # owner = "Half-Shot"; + # repo = "matrix-presents"; + # rev = "7643fc47b7eca0db5e265513c2ecb4ceb58cda78"; + # sha256 = "1ci0dgbyaghgyxm9wvl77aydj937vg9kajldi8nskx7sd42dv9wj"; + #}; + + src = ~/Documents/matrix-presents; + + buildPhase = '' + cp ${configOverrideFile} deps/matrix-presents/config.json + ls -alh deps/matrix-presents/node_modules/ + #mkdir -p deps/matrix-presents/node_modules/animate.css + #cp node_modules/animate.css/animate.css deps/matrix-presents/node_modules/animate.css/animate.css + yarn build + ''; + + installPhase = '' + mkdir $out + cp -r deps/synapse-admin/build/* $out + ''; + + distPhase = "true"; +} +