docs: annotate nix path resolution

This commit is contained in:
Peter Steinberger
2026-01-01 09:30:12 +01:00
parent f6956320f9
commit 0a9f06d60f
4 changed files with 4 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import Foundation
enum ClawdisEnv { enum ClawdisEnv {
static func path(_ key: String) -> String? { static func path(_ key: String) -> String? {
// Normalize env overrides once so UI + file IO stay consistent.
guard let value = ProcessInfo.processInfo.environment[key]? guard let value = ProcessInfo.processInfo.environment[key]?
.trimmingCharacters(in: .whitespacesAndNewlines), .trimmingCharacters(in: .whitespacesAndNewlines),
!value.isEmpty !value.isEmpty

View File

@@ -122,6 +122,7 @@ enum DeviceModelCatalog {
} }
private static func locateResourceBundle() -> Bundle? { private static func locateResourceBundle() -> Bundle? {
// Prefer module bundle (SwiftPM/tests), then main app bundle (packaged app).
if let bundle = self.bundleIfContainsDeviceModels(Bundle.module) { if let bundle = self.bundleIfContainsDeviceModels(Bundle.module) {
return bundle return bundle
} }

View File

@@ -105,6 +105,7 @@ struct SettingsRootView: View {
} }
private var nixManagedBanner: some View { private var nixManagedBanner: some View {
// Prefer gateway-resolved paths; fall back to local env defaults if disconnected.
let snapshotPaths = GatewayConnection.shared.snapshotPaths() let snapshotPaths = GatewayConnection.shared.snapshotPaths()
let configPath = snapshotPaths.configPath ?? ClawdisPaths.configURL.path let configPath = snapshotPaths.configPath ?? ClawdisPaths.configURL.path
let stateDir = snapshotPaths.stateDir ?? ClawdisPaths.stateDirURL.path let stateDir = snapshotPaths.stateDir ?? ClawdisPaths.stateDirURL.path

View File

@@ -639,6 +639,7 @@ function buildSnapshot(): Snapshot {
health: emptyHealth, health: emptyHealth,
stateVersion: { presence: presenceVersion, health: healthVersion }, stateVersion: { presence: presenceVersion, health: healthVersion },
uptimeMs, uptimeMs,
// Surface resolved paths so UIs can display the true config location.
configPath: CONFIG_PATH_CLAWDIS, configPath: CONFIG_PATH_CLAWDIS,
stateDir: STATE_DIR_CLAWDIS, stateDir: STATE_DIR_CLAWDIS,
}; };