diff --git a/home/profiles/opencode/default.nix b/home/profiles/opencode/default.nix index 10fce1f..804e1a0 100644 --- a/home/profiles/opencode/default.nix +++ b/home/profiles/opencode/default.nix @@ -18,10 +18,6 @@ let # github-mcp-server binary path from nixpkgs githubMcpServer = "${pkgs.github-mcp-server}/bin/github-mcp-server"; -<<<<<<< HEAD - # Plugin sources fetched via flake inputs - handoffSrc = inputs.opencode-handoff; -======= # Upstream plugin/skill sources pinned via fetchFromGitHub opencode-handoff-src = pkgs.fetchFromGitHub { owner = "Chickensoupwithrice"; @@ -65,7 +61,6 @@ let # Claude Code PostToolUse hook (local file, not a patch of upstream) cp ${./plugins/learning-opportunities-auto.js} $out/learning-opportunities-auto.js ''; ->>>>>>> 64f30fc4d82e01dc9b381096bb4cc8cd5498c6c4 in { home.packages = [ -- 2.51.2 From 5efd86d126ed81760147c7356f9798d3491e611f Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Wed, 15 Apr 2026 19:19:01 -0700 Subject: [PATCH 2/4] opencode: fix handoff --- home/profiles/opencode/default.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/home/profiles/opencode/default.nix b/home/profiles/opencode/default.nix index 804e1a0..4672bbf 100644 --- a/home/profiles/opencode/default.nix +++ b/home/profiles/opencode/default.nix @@ -22,8 +22,8 @@ let opencode-handoff-src = pkgs.fetchFromGitHub { owner = "Chickensoupwithrice"; repo = "opencode-handoff"; - rev = "b18d546e567c8c15c7ce8377f82f1b81cd838890"; - hash = "sha256-1wDwwz7gcKLeCr0kqwQtQi7UWf12AYiPDL8YT9iFO08="; + rev = "6a6600e"; + hash = "sha256-x1IPqv/oCfGn6mS9twryhWtZcJlC+QPqz8LIhbYBEy8="; }; learning-opportunities-src = pkgs.fetchFromGitHub { @@ -120,12 +120,22 @@ in "opencode/skills/learning-goal".source = "${learning-goal-src}/learning-goal/skills/learning-goal"; "opencode/skills/orient".source = "${learning-opportunities-src}/orient/skills/orient"; - # Plugins: combined derivation with correct layout for OpenCode's - # plugin loader (only entry points at top level) - "opencode/plugins".source = opencode-plugins; }; home.file = lib.mkIf isBox { "usr/.opencode/agents.md".source = ./agents/box.md; }; + + # Copy plugin files into the writable plugins directory rather than symlinking. + # Bun's import() resolves symlinks to their real path (inside the read-only Nix + # store), then searches for node_modules/ relative to that real path -- which fails + # because node_modules/ lives at ~/.config/opencode/node_modules/, not in the store. + # Copying (with -L to dereference symlinks) ensures plugin files physically live + # alongside node_modules/ so Bun's module resolution can find dependencies. + home.activation.opencode-plugins = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + rm -rf "$HOME/.config/opencode/plugins" + mkdir -p "$HOME/.config/opencode/plugins" + cp -rL ${opencode-plugins}/* "$HOME/.config/opencode/plugins/" + chmod -R u+w "$HOME/.config/opencode/plugins" + ''; } -- 2.51.2 From 2b9051dd79ee41a9c81fc93c8ea5992e1385dd93 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Thu, 16 Apr 2026 22:54:37 -0700 Subject: [PATCH 3/4] curve+box: add openai api key --- hosts/box/default.nix | 2 ++ hosts/curve/default.nix | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hosts/box/default.nix b/hosts/box/default.nix index fa1def4..3a47404 100644 --- a/hosts/box/default.nix +++ b/hosts/box/default.nix @@ -94,6 +94,8 @@ age.secrets.github-token.owner = "anish"; age.secrets.anthropicToken.file = "${self}/secrets/anthropicToken.age"; age.secrets.anthropicToken.owner = "anish"; + age.secrets.openaiToken.file = "${self}/secrets/openaiToken.age"; + age.secrets.openaiToken.owner = "anish"; mossnet.wg = { enable = true; ips = [ "10.0.69.4/24" ]; diff --git a/hosts/curve/default.nix b/hosts/curve/default.nix index 3f6559e..9ee76d2 100644 --- a/hosts/curve/default.nix +++ b/hosts/curve/default.nix @@ -12,7 +12,6 @@ ../profiles/mimetypes ../profiles/syncthing ../profiles/mossnet-hosts - ../profiles/opencode-server # ../profiles/fly-wg # ../profiles/kuberenetes # ../profiles/mount-mossnet @@ -115,6 +114,9 @@ age.secrets.github-token.owner = "anish"; age.secrets.anthropicToken.file = "${self}/secrets/anthropicToken.age"; age.secrets.anthropicToken.owner = "anish"; + age.secrets.openaiToken.file = "${self}/secrets/openaiToken.age"; + age.secrets.openaiToken.owner = "anish"; + mossnet.wg = { enable = true; ips = [ "10.0.69.2/24" ]; -- 2.51.2 From 1e51e830249d345c3ccb3d189a62a66bed745691 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Thu, 16 Apr 2026 22:55:04 -0700 Subject: [PATCH 4/4] lituus: add matrix register-user script --- hosts/profiles/matrix/register-user.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 hosts/profiles/matrix/register-user.sh diff --git a/hosts/profiles/matrix/register-user.sh b/hosts/profiles/matrix/register-user.sh new file mode 100755 index 0000000..0530d3c --- /dev/null +++ b/hosts/profiles/matrix/register-user.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p matrix-synapse + +set -euo pipefail + +SYNAPSE_CONFIG="/run/agenix/synapse-config" + +if [ $# -eq 0 ]; then + echo "Usage: register-user.sh -u USERNAME -p PASSWORD [--no-admin | -a]" + echo "Example: register-user.sh -u alice -p PLEASECHANGETHISPASSWORD --no-admin" + exit 1 +fi + +SHARED_SECRET=$(sudo sed -n 's/.*registration_shared_secret:[[:space:]]*"\?\([^"]*\)"\?.*/\1/p' "$SYNAPSE_CONFIG") + +if [ -z "$SHARED_SECRET" ]; then + echo "Error: Could not extract registration_shared_secret from $SYNAPSE_CONFIG" + exit 1 +fi + +register_new_matrix_user \ + -k "$SHARED_SECRET" \ + "$@" \ + http://localhost:8448