mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-08 15:22:05 +08:00
Systemd user services don't inherit shell environment. Add PATH with essential tools (git, coreutils, gnugrep, gnused, findutils) so opencode can run basic commands.
21 lines
415 B
Nix
21 lines
415 B
Nix
{ 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}" ];
|
|
};
|
|
}
|