This repository has no description
1.9 kB
65 lines
1# Headless Orca runtime (https://onorca.dev), reachable over retiolum.
2# Agents, terminals and worktrees run as the orca user; log in as orca to
3# set up agents and to clone repos.
4# Pairing URL for a client (Settings → Remote Orca Servers → Add Server):
5# journalctl -u orca-server | grep 'Pairing URL'
6{
7 self,
8 config,
9 pkgs,
10 ...
11}:
12let
13 llm = self.inputs.llm-agents.packages.${pkgs.system};
14 port = 6768;
15in
16{
17 users.users.orca = {
18 isNormalUser = true;
19 home = "/home/orca";
20 createHome = true;
21 group = "users";
22 useDefaultShell = true;
23 openssh.authorizedKeys.keys = [
24 self.keys.ssh.barnacle.public
25 self.keys.ssh.yubi_pgp.public
26 self.keys.ssh.termux_massulus.public
27 self.keys.ssh.yubi1.public
28 self.keys.ssh.yubi2.public
29 self.keys.ssh.solo2.public
30 self.keys.ssh.ignavia.public
31 self.keys.ssh.phonetpm_massulus.public
32 self.keys.ssh.massulus.public
33 ];
34 packages = [
35 llm.orca
36 pkgs.omp
37 # GitHub issues/PRs in the work item lists.
38 pkgs.gh
39 ];
40 };
41
42 systemd.services.orca-server = {
43 description = "Orca headless runtime";
44 wantedBy = [ "multi-user.target" ];
45 after = [ "network-online.target" ];
46 wants = [ "network-online.target" ];
47 # Terminals and agents started by Orca inherit this, so give them the
48 # same tools as an interactive login of the orca user.
49 path = [
50 "/run/wrappers"
51 "/etc/profiles/per-user/orca"
52 "/run/current-system/sw"
53 ];
54 serviceConfig = {
55 ExecStart = "${llm.orca}/bin/orca serve --port ${toString port} --pairing-address ${config.networking.hostName}.r";
56 Restart = "on-failure";
57 RestartSec = 10;
58 User = "orca";
59 Group = "users";
60 WorkingDirectory = "/home/orca";
61 };
62 };
63
64 networking.firewall.interfaces.retiolum.allowedTCPPorts = [ port ];
65}