Skip to content

Instantly share code, notes, and snippets.

@jason9075
Created February 7, 2026 08:55
Show Gist options
  • Select an option

  • Save jason9075/a435a7d0cbc9032d7ed6c3364bec3e6c to your computer and use it in GitHub Desktop.

Select an option

Save jason9075/a435a7d0cbc9032d7ed6c3364bec3e6c to your computer and use it in GitHub Desktop.
put this file in ~/.config/opencode/plugins
import fs from 'fs';
export const NixDevelopPlugin = async ({ directory, client }) => {
return {
"tool.execute.before": async (input, output) => {
if (input.tool === "bash") {
const flakePath = `${directory}/flake.nix`;
if (fs.existsSync(flakePath)) {
const originalCommand = output.args.command;
if (!originalCommand.includes("nix develop")) {
output.args.command = `nix develop --command ${originalCommand}`;
}
}
}
},
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment