summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/matrix-recorder/default.nix
blob: 633219626b68ffd8b28f2215dfe25ad72753a94b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ stdenv, pkgs }:
(import ./composition.nix {
  inherit pkgs;
  inherit (stdenv.hostPlatform) system;
})."package".override {
  postInstall = ''
    mkdir "$out/bin"
    echo '#!/bin/sh' >> "$out/bin/matrix-recorder"
    echo "'${pkgs.nodejs-12_x}/bin/node'" \
         "'$out/lib/node_modules/matrix-recorder/matrix-recorder.js'" \
         '"$@"' >> "$out/bin/matrix-recorder"
    echo '#!/bin/sh' >> "$out/bin/matrix-recorder-to-html"
    echo 'cd "$1"' >> "$out/bin/matrix-recorder-to-html"
    echo "test -d templates/ || ln -sfT '$out/lib/node_modules/matrix-recorder/templates' templates" >> "$out/bin/matrix-recorder-to-html"
    echo "'${pkgs.nodejs-12_x}/bin/node'" \
         "'$out/lib/node_modules/matrix-recorder/recorder-to-html.js'" \
         '.' >> "$out/bin/matrix-recorder-to-html"
    chmod a+x "$out/bin/matrix-recorder"
    chmod a+x "$out/bin/matrix-recorder-to-html"
  '';
  meta = {
    description = "Matrix message recorder";
    homepage = "https://gitlab.com/argit/matrix-recorder/";
    license = stdenv.lib.licenses.mit;
    maintainers = [ stdenv.lib.maintainers.raskin ];
  };
}