opencode-web: add PATH environment for systemd service

Systemd user services don't inherit shell environment. Add PATH with
essential tools (git, coreutils, gnugrep, gnused, findutils) so opencode
can run basic commands.
This commit is contained in:
Sridhar Ratnakumar 2026-03-12 09:12:45 -04:00
parent cd4805d5dd
commit 86fc60b46c

View file

@ -1,9 +1,21 @@
{ config, lib, pkgs, ... }:
let
pathPackages = [
pkgs.git
pkgs.coreutils
pkgs.gnugrep
pkgs.gnused
pkgs.findutils
];
in
{
programs.opencode.web = {
enable = true;
# Bind to Tailscale IP only
extraArgs = [ "--hostname" "100.122.32.106" "--port" "4096" ];
};
systemd.user.services.opencode-web.Service = {
Environment = [ "PATH=${lib.makeBinPath pathPackages}" ];
};
}