This repository has no description
2.0 kB
46 lines
1{ self, inputs, ... }:
2{
3 perSystem =
4 { pkgs, system, ... }:
5 let
6 # Client omp carrying covibe's env-driven headless collab autostart
7 # (OMP_COLLAB_*) -- the exact patch the neoprism covibe service uses, so a
8 # session hosts natively against the covibe relay. `covibe session` mints
9 # the room and passes OMP_COLLAB_* to this omp.
10 ompCollab = self.legacyPackages.${system}.llm.omp.overrideAttrs (o: {
11 patches = (o.patches or [ ]) ++ [ ../../2configs/omp-collab-autostart.patch ];
12 });
13 covibe = inputs.covibe.packages.${system}.covibe;
14 in
15 {
16 # Launch omp as a co-vibing session from any machine: `covibe session
17 # --dashboard` announces the session over the dashboard's keyless REST API
18 # (name + collab links, heartbeat + pane push), so it shows up in the
19 # covibe.lassul.us overview just like a session started locally on
20 # neoprism, and is joinable / browser-viewable via the collab relay. The
21 # dashboard GCs the announcement once the session exits.
22 packages.covibe =
23 (pkgs.writeShellApplication {
24 name = "covibe";
25 runtimeInputs = [ pkgs.coreutils ];
26 text = ''
27 dashboard="''${COVIBE_DASHBOARD:-https://covibe.lassul.us}"
28 relay="''${COVIBE_LOCAL_RELAY:-wss://covibe.lassul.us}"
29 web="''${COVIBE_WEB_CLIENT:-https://covibe.lassul.us/c}"
30 host="''${COVIBE_RELAY_HOST:-covibe.lassul.us}"
31 name="''${COVIBE_NAME:-$(basename "$PWD")}"
32
33 exec ${covibe}/bin/covibe session \
34 --dashboard "$dashboard" \
35 --relay-host "$host" \
36 --web-client "$web" \
37 --local-relay "$relay" \
38 --omp ${ompCollab}/bin/omp \
39 --name "$name" \
40 --dir "$PWD" \
41 -- "$@"
42 '';
43 }).overrideAttrs
44 { passthru.usage = builtins.readFile ./usage.kdl; };
45 };
46}