Enable opencode web service on pureintent (#104)

- Add opencode/web.nix module for web service configuration
- Bind to Tailscale IP (100.122.32.106) on port 4096
- Pass JUSPAY_API_KEY from agenix secret to service
- Update flake inputs: nixpkgs/unstable, nix-darwin/master, home-manager/master
This commit is contained in:
Sridhar Ratnakumar 2026-03-11 22:58:45 -04:00 committed by GitHub
parent 0e07a3fbc2
commit cd4805d5dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 86 additions and 129 deletions

View file

@ -20,6 +20,7 @@ in
"${homeMod}/work/juspay.nix"
"${homeMod}/services/vira.nix"
"${homeMod}/opencode"
"${homeMod}/opencode/web.nix"
# "${homeMod}/services/dropbox.nix"
# "${homeMod}/services/obsidian.nix"
@ -27,14 +28,6 @@ in
# Remote builders
"${homeMod}/nix/buildMachines"
"${homeMod}/nix/buildMachines/sincereintent.nix"
{
services.ttyd = {
enable = true;
port = 9999;
command = "${lib.getExe config.programs.tmux.package} new-session -A -s ttyd";
write = true;
};
}
];
nix.settings = {

187
flake.lock generated
View file

@ -42,11 +42,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1762618334,
"narHash": "sha256-wyT7Pl6tMFbFrs8Lk/TlEs81N6L+VSybPfiIgzU8lbQ=",
"lastModified": 1770165109,
"narHash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=",
"owner": "ryantm",
"repo": "agenix",
"rev": "fcdea223397448d35d9b31f798479227e80183f6",
"rev": "b027ee29d959fda4b60b57566d64c98a202e0feb",
"type": "github"
},
"original": {
@ -256,11 +256,11 @@
]
},
"locked": {
"lastModified": 1711462743,
"narHash": "sha256-3wKGpHy9Kyh98DrziqC/s//60Q0pE17NgbY93L0uWng=",
"lastModified": 1773025010,
"narHash": "sha256-khlHllTsovXgT2GZ0WxT4+RvuMjNeR5OW0UYeEHPYQo=",
"owner": "nix-community",
"repo": "disko",
"rev": "a6717b1afee7ae955c61eefdf0ce8f864ef78115",
"rev": "7b9f7f88ab3b339f8142dc246445abb3c370d3d3",
"type": "github"
},
"original": {
@ -303,11 +303,11 @@
"unionmount": "unionmount"
},
"locked": {
"lastModified": 1763605604,
"narHash": "sha256-lKeuYfl/31Yks4SR8Hx3r5Kkby6yDRhxcLyy8Y092ew=",
"lastModified": 1766432517,
"narHash": "sha256-2y58CyRlcPIQgVvPxsxKOp6aFO6S16CyYOJxFfBaKE8=",
"owner": "srid",
"repo": "emanote",
"rev": "f755c5344cdebab8ee839461cda2fe2112644042",
"rev": "6deb47e5db07221709d5214820ff4456e2bda92d",
"type": "github"
},
"original": {
@ -379,11 +379,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1726153070,
"narHash": "sha256-HO4zgY0ekfwO5bX0QH/3kJ/h4KvUDFZg8YpkNwIbg1U=",
"lastModified": 1772408722,
"narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a",
"rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3",
"type": "github"
},
"original": {
@ -476,24 +476,6 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"fourmolu-nix": {
"locked": {
"lastModified": 1707266073,
@ -574,11 +556,11 @@
"git-hooks_3": {
"flake": false,
"locked": {
"lastModified": 1732021966,
"narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=",
"lastModified": 1772893680,
"narHash": "sha256-JDqZMgxUTCq85ObSaFw0HhE+lvdOre1lx9iI6vYyOEs=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
"rev": "8baab586afc9c9b57645a734c820e4ac0a604af9",
"type": "github"
},
"original": {
@ -621,11 +603,11 @@
},
"github-nix-ci": {
"locked": {
"lastModified": 1728494632,
"narHash": "sha256-V3xldtMU7YidLibCHlkaoOdUZ0DFjEhYGtu6y/l2xAg=",
"lastModified": 1754092430,
"narHash": "sha256-S4Oe9aZK/UnWuj6zUlVeSDmC/QjEPHJm2gaSk/VMir4=",
"owner": "juspay",
"repo": "github-nix-ci",
"rev": "7c612e5b5606c7aa86d4b910d27cc66281702f37",
"rev": "edd0486a9208524eff40712a8ce835260c5b412a",
"type": "github"
},
"original": {
@ -682,16 +664,15 @@
"heist-extra": {
"flake": false,
"locked": {
"lastModified": 1755566620,
"narHash": "sha256-J/AmooFxQkFas0qWe2rxWJw9vTzG56nX22grUDMw9Oc=",
"lastModified": 1766109391,
"narHash": "sha256-ytHgIoRlkI5K0SDq33znlY0wjlqcwoQCe1z9JfHT/Fw=",
"owner": "srid",
"repo": "heist-extra",
"rev": "ee59ac1bd98ef90a902158b46401b66f4a3aad3b",
"rev": "81f1ea0cf1226215430171dbe613a2988c6cc46a",
"type": "github"
},
"original": {
"owner": "srid",
"ref": "0.4.0.0",
"repo": "heist-extra",
"type": "github"
}
@ -719,16 +700,16 @@
]
},
"locked": {
"lastModified": 1770260404,
"narHash": "sha256-3iVX1+7YUIt23hBx1WZsUllhbmP2EnXrV8tCRbLxHc8=",
"lastModified": 1773264496,
"narHash": "sha256-uwFY0+UfaGEo6205ixeBjplZxHWr56UQef+MtmJ0PW0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0d782ee42c86b196acff08acfbf41bb7d13eed5b",
"rev": "32f78141a98098efed490842923b25ecb93b9b9f",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.11",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
@ -880,11 +861,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1772801106,
"narHash": "sha256-GC2p++UMNTLMFs5KnuJCXGm9PwgzXz/RMtRBDP8Y4nc=",
"lastModified": 1773241852,
"narHash": "sha256-kwETflAbufOL32E1dRkJDTgcroafwN8HZqxjAaLItJw=",
"owner": "numtide",
"repo": "llm-agents.nix",
"rev": "96ad1f1a0d38b62403202dba08f7a5f890ab244a",
"rev": "e21490459caf641e19cac7ad7679f1121d643e0c",
"type": "github"
},
"original": {
@ -900,16 +881,16 @@
]
},
"locked": {
"lastModified": 1767634391,
"narHash": "sha256-owcSz2ICqTSvhBbhPP+1eWzi88e54rRZtfCNE5E/wwg=",
"lastModified": 1773000227,
"narHash": "sha256-zm3ftUQw0MPumYi91HovoGhgyZBlM4o3Zy0LhPNwzXE=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "08585aacc3d6d6c280a02da195fdbd4b9cf083c2",
"rev": "da529ac9e46f25ed5616fd634079a5f3c579135f",
"type": "github"
},
"original": {
"owner": "LnL7",
"ref": "nix-darwin-25.11",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
@ -921,11 +902,11 @@
]
},
"locked": {
"lastModified": 1771130777,
"narHash": "sha256-UIKOwG0D9XVIJfNWg6+gENAvQP+7LO46eO0Jpe+ItJ0=",
"lastModified": 1772945408,
"narHash": "sha256-PMt48sEQ8cgCeljQ9I/32uoBq/8t8y+7W/nAZhf72TQ=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "efec7aaad8d43f8e5194df46a007456093c40f88",
"rev": "1c1d8ea87b047788fd7567adf531418c5da321ec",
"type": "github"
},
"original": {
@ -967,11 +948,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1743167577,
"narHash": "sha256-I09SrXIO0UdyBFfh0fxDq5WnCDg8XKmZ1HQbaXzMA1k=",
"lastModified": 1772972630,
"narHash": "sha256-mUJxsNOrBMNOUJzN0pfdVJ1r2pxeqm9gI/yIKXzVVbk=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "0ed819e708af17bfc4bbc63ee080ef308a24aa42",
"rev": "3966ce987e1a9a164205ac8259a5fe8a64528f72",
"type": "github"
},
"original": {
@ -1026,16 +1007,13 @@
}
},
"nixos-vscode-server": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_5"
},
"flake": false,
"locked": {
"lastModified": 1684517665,
"narHash": "sha256-SaAr66uCQ8CF75jIr23FZjk1+9Kfwm5sQnwV25206Gs=",
"lastModified": 1770124655,
"narHash": "sha256-yHmd2B13EtBUPLJ+x0EaBwNkQr9LTne1arLVxT6hSnY=",
"owner": "nix-community",
"repo": "nixos-vscode-server",
"rev": "1e1358493df6529d4c7bc4cc3066f76fd16d4ae6",
"rev": "92ce71c3ba5a94f854e02d57b14af4997ab54ef0",
"type": "github"
},
"original": {
@ -1062,14 +1040,17 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1725233747,
"narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
"lastModified": 1772328832,
"narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742",
"type": "github"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs_2": {
@ -1106,11 +1087,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1772674223,
"narHash": "sha256-/suKbHSaSmuC9UY7G0VRQ3aO+QKqxAQPQ19wG7QNkF8=",
"lastModified": 1773110118,
"narHash": "sha256-mPAG8phMbCReKSiKAijjjd3v7uVcJOQ75gSjGJjt/Rk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "66d9241e3dc2296726dc522e62dbfe89c7b449f3",
"rev": "e607cb5360ff1234862ac9f8839522becb853bb9",
"type": "github"
},
"original": {
@ -1122,34 +1103,21 @@
},
"nixpkgs_5": {
"locked": {
"lastModified": 1682526928,
"narHash": "sha256-2cKh4O6t1rQ8Ok+v16URynmb0rV7oZPEbXkU0owNLQs=",
"path": "/nix/store/wsci3as2flp84w6w5gzbyphxzf6ilasd-source",
"rev": "d6b863fd9b7bb962e6f9fdf292419a775e772891",
"type": "path"
"lastModified": 1772963539,
"narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9dcb002ca1690658be4a04645215baea8b95f31d",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1771419570,
"narHash": "sha256-bxAlQgre3pcQcaRUm/8A0v/X8d2nhfraWSFqVmMcBcU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "6d41bc27aaf7b6a3ba6b169db3bd5d6159cfaa47",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1765803225,
"narHash": "sha256-xwaZV/UgJ04+ixbZZfoDE8IsOWjtvQZICh9aamzPnrg=",
@ -1171,14 +1139,14 @@
"nixpkgs": [
"nixpkgs"
],
"systems": "systems_5"
"systems": "systems_4"
},
"locked": {
"lastModified": 1771135771,
"narHash": "sha256-wyvBIhDuyCRyjB3yPg77qoyxrlgQtBR1rVW3c9knV3E=",
"lastModified": 1772402258,
"narHash": "sha256-3DmCFOdmbkFML1/G9gj8Wb+rCCZFPOQtNoMCpqOF8SA=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "ed0424f0b08d303a7348f52f7850ad1b2704f9ba",
"rev": "21ae25e13b01d3b4cdc750b5f9e7bad68b150c10",
"type": "github"
},
"original": {
@ -1253,7 +1221,7 @@
"nixos-hardware": "nixos-hardware",
"nixos-unified": "nixos-unified_2",
"nixos-vscode-server": "nixos-vscode-server",
"nixpkgs": "nixpkgs_6",
"nixpkgs": "nixpkgs_5",
"nixvim": "nixvim",
"vira": "vira"
}
@ -1379,21 +1347,6 @@
"type": "github"
}
},
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tabler-icons-hs": {
"flake": false,
"locked": {
@ -1478,7 +1431,7 @@
"nix-serve-ng": "nix-serve-ng",
"nix-systems": "nix-systems",
"nixos-unified": "nixos-unified_3",
"nixpkgs": "nixpkgs_7",
"nixpkgs": "nixpkgs_6",
"process-compose-flake": "process-compose-flake_2",
"record-hasfield": "record-hasfield",
"servant-event-stream": "servant-event-stream",

View file

@ -8,10 +8,10 @@
flake-parts.url = "github:hercules-ci/flake-parts";
# Principle inputs
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
nix-darwin.url = "github:LnL7/nix-darwin/nix-darwin-25.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-darwin.url = "github:LnL7/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager/release-25.11";
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = "github:NixOS/nixos-hardware";
nixos-unified.url = "github:srid/nixos-unified";

View file

@ -6,7 +6,9 @@ in
name = "Juspay";
options = {
baseURL = "https://grid.ai.juspay.net";
apiKey = "{env:JUSPAY_API_KEY}";
# HACK: hardcoded path to agenix secret. Should use XDG_RUNTIME_DIR but
# OpenCode's {file:...} doesn't support environment variable expansion.
apiKey = "{file:/run/user/1000/agenix/juspay-anthropic-api-key}";
timeout = 600000;
};
inherit models;

View file

@ -0,0 +1,9 @@
{ config, lib, pkgs, ... }:
{
programs.opencode.web = {
enable = true;
# Bind to Tailscale IP only
extraArgs = [ "--hostname" "100.122.32.106" "--port" "4096" ];
};
}