diff --git a/aspects/hosts/_alexandria/ai.nix b/aspects/hosts/_alexandria/ai.nix index cb6aedb..0969177 100644 --- a/aspects/hosts/_alexandria/ai.nix +++ b/aspects/hosts/_alexandria/ai.nix @@ -2,23 +2,30 @@ let mkNginxVHosts = inputs.self.lib.mkNginxVHosts; - openWebUiPort = 8080; + opencodePort = 58801; + opencodePackage = inputs.nix-ai-tools.packages.${pkgs.stdenv.hostPlatform.system}.opencode; in { services.nginx.virtualHosts = mkNginxVHosts { domains = { - "ai.baduhai.dev".locations."/".proxyPass = "http://127.0.0.1:${toString openWebUiPort}/"; + "ai.baduhai.dev".locations."/".proxyPass = "http://127.0.0.1:${toString opencodePort}/"; }; }; - services.open-webui = { - enable = true; - package = inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.open-webui; - host = "127.0.0.1"; - port = openWebUiPort; - environment = { - WEBUI_URL = "https://ai.baduhai.dev"; + systemd.services.opencode-web = { + description = "OpenCode Web UI"; + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + Type = "simple"; + DynamicUser = true; + StateDirectory = "opencode-web"; + WorkingDirectory = "/var/lib/opencode-web"; + Environment = "HOME=/var/lib/opencode-web"; + ExecStart = "${opencodePackage}/bin/opencode web --hostname 127.0.0.1 --port ${toString opencodePort}"; + Restart = "on-failure"; + RestartSec = "5s"; }; }; } diff --git a/data/services.nix b/data/services.nix index de76d5e..4ac2407 100644 --- a/data/services.nix +++ b/data/services.nix @@ -44,7 +44,7 @@ host = "alexandria"; } { - name = "open-webui"; + name = "opencode-web"; domain = "ai.baduhai.dev"; host = "alexandria"; } diff --git a/flake.lock b/flake.lock index 1dc1910..09af71a 100644 --- a/flake.lock +++ b/flake.lock @@ -61,11 +61,11 @@ "base16-helix": { "flake": false, "locked": { - "lastModified": 1776754714, - "narHash": "sha256-E3OAK27smtATTmX45uoTSRsVD+Y+ZiVVfgM/tjpbtYg=", + "lastModified": 1760703920, + "narHash": "sha256-m82fGUYns4uHd+ZTdoLX2vlHikzwzdu2s2rYM2bNwzw=", "owner": "tinted-theming", "repo": "base16-helix", - "rev": "4d508123037e7851ad36ebf7d9c48b0e9e1eb581", + "rev": "d646af9b7d14bff08824538164af99d0c521b185", "type": "github" }, "original": { @@ -122,6 +122,7 @@ "nix-ai-tools", "flake-parts" ], + "import-tree": "import-tree_2", "nixpkgs": [ "nix-ai-tools", "nixpkgs" @@ -136,16 +137,16 @@ ] }, "locked": { - "lastModified": 1777369708, - "narHash": "sha256-1xW7cRZNsFNPQD+cE0fwnLVStnDth0HSoASEIFeT7uI=", - "owner": "nix-community", + "lastModified": 1776182890, + "narHash": "sha256-+/VOe8XGq5klpU+I19D+3TcaR7o+Cwbq67KNF7mcFak=", + "owner": "Mic92", "repo": "bun2nix", - "rev": "e659e1cc4b8e1b21d0aa85f1c481f9db61ecfa98", + "rev": "648d293c51e981aec9cb07ba4268bc19e7a8c575", "type": "github" }, "original": { - "owner": "nix-community", - "ref": "staging-2.1.0", + "owner": "Mic92", + "ref": "catalog-support", "repo": "bun2nix", "type": "github" } @@ -177,11 +178,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1777713215, - "narHash": "sha256-8GzXDOXckDWwST8TY5DbwYFjdvQLlP7K9CLSVx6iTTo=", + "lastModified": 1776613567, + "narHash": "sha256-gC9Cp5ibBmGD5awCA9z7xy6MW6iJufhazTYJOiGlCUI=", "owner": "nix-community", "repo": "disko", - "rev": "63b4e7e6cf75307c1d26ac3762b886b5b0247267", + "rev": "32f4236bfc141ae930b5ba2fb604f561fed5219d", "type": "github" }, "original": { @@ -193,11 +194,11 @@ "firefox-gnome-theme": { "flake": false, "locked": { - "lastModified": 1776136500, - "narHash": "sha256-r0gN2brVWA351zwMV0Flmlcd6SGMvYqFbvC3DfKFM8Y=", + "lastModified": 1775176642, + "narHash": "sha256-2veEED0Fg7Fsh81tvVDNYR6SzjqQxa7hbi18Jv4LWpM=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "0f8ba203d475587f477e7ae12661bd8459e225b7", + "rev": "179704030c5286c729b5b0522037d1d51341022c", "type": "github" }, "original": { @@ -227,11 +228,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1777678872, - "narHash": "sha256-EPIFsulyon7Z1vLQq5Fk64GR8L7cQsT+IPhcsukVbgk=", + "lastModified": 1775087534, + "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "5250617bffd85403b14dbf43c3870e7f255d2c16", + "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b", "type": "github" }, "original": { @@ -248,11 +249,11 @@ ] }, "locked": { - "lastModified": 1777678872, - "narHash": "sha256-EPIFsulyon7Z1vLQq5Fk64GR8L7cQsT+IPhcsukVbgk=", + "lastModified": 1775087534, + "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "5250617bffd85403b14dbf43c3870e7f255d2c16", + "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b", "type": "github" }, "original": { @@ -382,11 +383,11 @@ ] }, "locked": { - "lastModified": 1777815398, - "narHash": "sha256-MrIhEoqXc4YsHEUfH4rDU/K09XnWcKntNhCjs7n7zi8=", + "lastModified": 1776777932, + "narHash": "sha256-0R3Yow/NzSeVGUke5tL7CCkqmss4Vmi6BbV6idHzq/8=", "owner": "nix-community", "repo": "home-manager", - "rev": "b5e86c1b19f178a8ee10f7cb747325e02e3d3991", + "rev": "5d5640599a0050b994330328b9fd45709c909720", "type": "github" }, "original": { @@ -472,6 +473,21 @@ "type": "github" } }, + "import-tree_2": { + "locked": { + "lastModified": 1763762820, + "narHash": "sha256-ZvYKbFib3AEwiNMLsejb/CWs/OL/srFQ8AogkebEPF0=", + "owner": "vic", + "repo": "import-tree", + "rev": "3c23749d8013ec6daa1d7255057590e9ca726646", + "type": "github" + }, + "original": { + "owner": "vic", + "repo": "import-tree", + "type": "github" + } + }, "nix-ai-tools": { "inputs": { "blueprint": "blueprint", @@ -482,11 +498,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1777833737, - "narHash": "sha256-vr9mvM9VQjd7p0vuBlKpb2Ia4fCEqiFSqH69hZn24U0=", + "lastModified": 1776828739, + "narHash": "sha256-Uo1SvxXlqcxbpoew8deTAbBWDlA/LnkiXQ1PIb95fUA=", "owner": "numtide", "repo": "llm-agents.nix", - "rev": "aba65497c7a653e78ac3966b8d3e0ace6c0f469f", + "rev": "bb6fb1ef73d5a46877a3fc623fedef5cbf3939e3", "type": "github" }, "original": { @@ -497,11 +513,11 @@ }, "nix-flatpak": { "locked": { - "lastModified": 1777402031, - "narHash": "sha256-6gkfl9y3+ti0Z6dgby8/R4/DRT8sWU0I0TLCIxwWtjk=", + "lastModified": 1776625032, + "narHash": "sha256-edvwHiFhgOiwywt6/Iwe+sSn6ybhU3WZGnIoiGcKjfQ=", "owner": "gmodena", "repo": "nix-flatpak", - "rev": "22a3adbe7c5c8c8a10a635d32c9ef7fc01a6e4b8", + "rev": "479e19f1decb390aa5b75cae13ddf87d763c74cc", "type": "github" }, "original": { @@ -518,11 +534,11 @@ ] }, "locked": { - "lastModified": 1777787189, - "narHash": "sha256-2KUbS/HhzWW3kkkY1+RiWj9mJ76VEXw8lBJzcCFKzfY=", + "lastModified": 1776829403, + "narHash": "sha256-oHVcvP2Ahhj1KUsEzp+2BQF55/r5VSa3QxdPdwE1p00=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "2dea2b920e7127b3afa8506713f23536651de312", + "rev": "c43246d4e9e506178b69baed075d797ec2d873e2", "type": "github" }, "original": { @@ -539,11 +555,11 @@ "optnix": "optnix" }, "locked": { - "lastModified": 1777152325, - "narHash": "sha256-8z6TM8o91moN+rhgzErnhluIHaS5X9B2xvZnIwFA88I=", + "lastModified": 1776470276, + "narHash": "sha256-qW2K6cxmiiRkaf86T2YHr/q2vm9Ozy42bodUNTfbrJY=", "owner": "nix-community", "repo": "nixos-cli", - "rev": "ad72187c1628a409f8bb7a9256cca94c0362c5b9", + "rev": "3d02dc9988106743164ffb9e6b8838140f8c66c4", "type": "github" }, "original": { @@ -570,11 +586,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1777168982, - "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", + "lastModified": 1774748309, + "narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", + "rev": "333c4e0545a6da976206c74db8773a1645b5870a", "type": "github" }, "original": { @@ -600,11 +616,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1777673416, - "narHash": "sha256-5c2POKPOjU40Kh0MirOdScBLG0bu9TAuPYAtPRNZMBs=", + "lastModified": 1776560675, + "narHash": "sha256-p68udKWWh7+V4ZPpcMDq0gTHWNZJnr4JPI+kHPPE40o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "26ef669cffa904b6f6832ab57b77892a37c1a671", + "rev": "e07580dae39738e46609eaab8b154de2488133ce", "type": "github" }, "original": { @@ -632,11 +648,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1777641297, - "narHash": "sha256-WNGcmeOZ8Tr9dq6ztCspYbzWFswr2mPebM9LpsfGxPk=", + "lastModified": 1776329215, + "narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c6d65881c5624c9cae5ea6cedef24699b0c0a4c0", + "rev": "b86751bc4085f48661017fa226dee99fab6c651b", "type": "github" }, "original": { @@ -664,11 +680,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1777578337, - "narHash": "sha256-Ad49moKWeXtKBJNy2ebiTQUEgdLyvGmTeykAQ9xM+Z4=", + "lastModified": 1776548001, + "narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=", "owner": "nixos", "repo": "nixpkgs", - "rev": "15f4ee454b1dce334612fa6843b3e05cf546efab", + "rev": "b12141ef619e0a9c1c84dc8c684040326f27cdcc", "type": "github" }, "original": { @@ -680,11 +696,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1777268161, - "narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=", + "lastModified": 1775036866, + "narHash": "sha256-ZojAnPuCdy657PbTq5V0Y+AHKhZAIwSIT2cb8UgAz/U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1c3fe55ad329cbcb28471bb30f05c9827f724c76", + "rev": "6201e203d09599479a3b3450ed24fa81537ebc4e", "type": "github" }, "original": { @@ -734,11 +750,11 @@ "noctalia-qs": "noctalia-qs" }, "locked": { - "lastModified": 1777772763, - "narHash": "sha256-MIFrNTX+x42UdOiL9lWmwyyymh80/pxtU4afvEizZDk=", + "lastModified": 1776774185, + "narHash": "sha256-riCnQWAxvltNd6KrkzQLdG2EMxODNxjQOB2Z67DA4KU=", "owner": "noctalia-dev", "repo": "noctalia-shell", - "rev": "f0469d2d6f9b1ca873932dcef6583f9d6a2eee28", + "rev": "d7b68652e79bce5813dc4fea7e51636a5da3e1b7", "type": "github" }, "original": { @@ -757,11 +773,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1777380063, - "narHash": "sha256-q5mWOEICcZzr+KnjIwDHV9EXiBxOC9cnBpxZbDAViU8=", + "lastModified": 1776585574, + "narHash": "sha256-j35EWhKoGhKrfcXcAOpoRVgXEPQt41Eukji/h59cnjk=", "owner": "noctalia-dev", "repo": "noctalia-qs", - "rev": "8742a7a748c43bf44eb6862a8ebd3591ed71502d", + "rev": "75d180c28a9ab4470e980f3d6f706ad6c5213add", "type": "github" }, "original": { @@ -782,11 +798,11 @@ ] }, "locked": { - "lastModified": 1777598946, - "narHash": "sha256-X239dAGaU1+gfDj8jKH8GzlqKMcxaVfXOio+uzBOkeE=", + "lastModified": 1775228139, + "narHash": "sha256-ebbeHmg+V7w8050bwQOuhmQHoLOEOfqKzM1KgCTexK4=", "owner": "nix-community", "repo": "NUR", - "rev": "5d55af01c0f86be583931fe99207fc56c14134b3", + "rev": "601971b9c89e0304561977f2c28fa25e73aa7132", "type": "github" }, "original": { @@ -859,11 +875,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1777835090, - "narHash": "sha256-VLH8zPweblCOvpnQXp4fVs7f6Q79YhXF5XFKlOrvIFk=", + "lastModified": 1776170745, + "narHash": "sha256-Tl1aZVP5EIlT+k0+iAKH018GLHJpLz3hhJ0LNQOWxCc=", "owner": "danth", "repo": "stylix", - "rev": "7989a1054b01153212dede6005abfd1576b8328c", + "rev": "e3861617645a43c9bbefde1aa6ac54dd0a44bfa9", "type": "github" }, "original": { @@ -1003,11 +1019,11 @@ "tinted-schemes": { "flake": false, "locked": { - "lastModified": 1777041405, - "narHash": "sha256-BAGZ7ObFV/9Z61OJZun7ifPyhkuHqNuW1QIhQ8LuzCo=", + "lastModified": 1772661346, + "narHash": "sha256-4eu3LqB9tPqe0Vaqxd4wkZiBbthLbpb7llcoE/p5HT0=", "owner": "tinted-theming", "repo": "schemes", - "rev": "5f868b3a338b6904c47f3833b9c411be641983a8", + "rev": "13b5b0c299982bb361039601e2d72587d6846294", "type": "github" }, "original": { @@ -1019,11 +1035,11 @@ "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1777169200, - "narHash": "sha256-h7dDbIzP5hDr9v97w9PL6jdAgXawmj6krcH+959rqpU=", + "lastModified": 1772934010, + "narHash": "sha256-x+6+4UvaG+RBRQ6UaX+o6DjEg28u4eqhVRM9kpgJGjQ=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "f798c2dce44ef815bb6b8f05a82135c7942d35ac", + "rev": "c3529673a5ab6e1b6830f618c45d9ce1bcdd829d", "type": "github" }, "original": { @@ -1035,11 +1051,11 @@ "tinted-zed": { "flake": false, "locked": { - "lastModified": 1777463218, - "narHash": "sha256-Bhkozqtq3BKLqWTlmKm8uAptfX4aRGI8QX3eEL54Vpc=", + "lastModified": 1772909925, + "narHash": "sha256-jx/5+pgYR0noHa3hk2esin18VMbnPSvWPL5bBjfTIAU=", "owner": "tinted-theming", "repo": "base16-zed", - "rev": "5768d08ed2e7944a26a958868cdb073cb8856dae", + "rev": "b4d3a1b3bcbd090937ef609a0a3b37237af974df", "type": "github" }, "original": { @@ -1097,11 +1113,11 @@ "systems": "systems_6" }, "locked": { - "lastModified": 1777815457, - "narHash": "sha256-tOHe63NSWVFYBry/KSd5wwF9Khha5AXT5Dqx+Z6ICww=", + "lastModified": 1776691047, + "narHash": "sha256-A9vBN0QrlmQHbveDox7E3n+Z1lzY8ch3sUcWR+Aiqu8=", "owner": "vicinaehq", "repo": "vicinae", - "rev": "5ab9b061690e9e8695ec62dc793f9a3bda2eb616", + "rev": "c0e4aa7dd2c21459cc9015b71841d0847f9749ef", "type": "github" }, "original": { @@ -1116,11 +1132,11 @@ "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1777564084, - "narHash": "sha256-O9VRkxg+2j+sh+c73wi4VeIBECoqW2PlnCR9Qe1nQKA=", + "lastModified": 1776844129, + "narHash": "sha256-DaYSEBVzTvUhTuoVe70NHphoq5JKUHqUhlNlN5XnTuU=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "d93443c0f6fdb3b179bed68856f322dba4842612", + "rev": "90706e6ab801e4fb7bc53343db67583631936192", "type": "github" }, "original": {