From 81340703980b42be486c9387289a907387e607f2 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Mon, 14 Sep 2026 23:34:49 -0500 Subject: [PATCH] feat(nixos): expose appctl and paths to non-interactive shells - Add a system-wide `appctl` binary wrapper via `writeShellScriptBin` to ensure the orchestrator is accessible outside of interactive bash sessions (e.g., direct SSH execution, cron, or systemd services). - Move custom script and binary paths to `environment.extraInit` so all subshells and non-interactive sessions inherit the correct $PATH. --- nixos/configuration.nix | 4 ++++ nixos/modules/shell.nix | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 9f0e417..fe035bb 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -102,6 +102,10 @@ }; environment.systemPackages = with pkgs; [ + # Core orchestrator wrapper (available system-wide including non-interactive SSH) + (writeShellScriptBin "appctl" '' + exec "''${CORE_DIR:-$HOME/Core}/scripts/appctl" "$@" + '') # Monitoring & diagnostics htop iotop diff --git a/nixos/modules/shell.nix b/nixos/modules/shell.nix index 21c815a..46e938f 100644 --- a/nixos/modules/shell.nix +++ b/nixos/modules/shell.nix @@ -20,6 +20,12 @@ qpdf # PDF decryption (used by pdf_dc function) ]; + # ── Environment & PATH ──────────────────────────────────────────────────────── + # Export Core scripts and user bin to /etc/set-environment so all subshells inherit them + environment.extraInit = '' + export PATH="$HOME/Core/scripts:$HOME/.local/bin:$HOME/.cargo/bin:$PATH" + ''; + # ── Bash configuration ──────────────────────────────────────────────────────── programs.bash = { shellAliases = {