Profpatsch/users/Profpatsch/asciinema-server/default.nix
 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
28
29
30
31
32
33
34
35
36
37
{ depot, pkgs, ... }:

let
  goDeps = import ../go-deps.nix { inherit depot pkgs; };
  avtGo = import ../avt-go/default.nix { inherit depot pkgs; };

  src = pkgs.runCommandLocal "asciinema-server-src" { } ''
    mkdir -p $out/static
    cp ${./main.go} $out/main.go
    cp ${./alis.go} $out/alis.go
    cp ${./static/asciinema-player.min.js} $out/static/asciinema-player.min.js
    cp ${./static/asciinema-player.css} $out/static/asciinema-player.css
    cp ${./static/live-player.js} $out/static/live-player.js
    cp ${./static/vt_js.js} $out/static/vt_js.js
    cp ${./static/vt_js_bg.wasm} $out/static/vt_js_bg.wasm
  '';

in depot.nix.buildGo.program {
  name = "asciinema-server";
  srcs = [ "${src}/main.go" "${src}/alis.go" ];
  deps = [
    goDeps.modernc-sqlite
    goDeps.zombiezen-go-sqlite
    goDeps.zombiezen-go-sqlite.sqlitex
    goDeps.klauspost-stdgozstd
    goDeps.golang-x-crypto.bcrypt
    goDeps.golang-x-image.font
    goDeps.golang-x-image.font.gofont.gomonobold
    goDeps.golang-x-image.font.opentype
    goDeps.golang-x-image.math.fixed
    goDeps.golang-x-net.websocket
    avtGo
    avtGo.types
    avtGo.parser
    avtGo.terminal
  ];
}