3 Commits

Author SHA1 Message Date
Sovran_Systems fa71a7da97 Merge pull request #167 from naturallaw777/copilot/fix-system-integrity-check
Fix: Running System Match always fails due to cwd-relative result symlink
2026-04-08 22:03:36 -05:00
copilot-swe-agent[bot] 5bd5c03e2f Fix: Use --print-out-paths instead of ./result symlink in verify-integrity endpoint
Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/b365659c-e6c9-45bf-9b12-b89addfbbbdd

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
2026-04-09 02:59:32 +00:00
copilot-swe-agent[bot] bf9e82cd79 Initial plan 2026-04-09 02:58:35 +00:00
+3 -4
View File
@@ -3088,13 +3088,12 @@ async def api_security_verify_integrity():
try: try:
current_system_path = os.path.realpath("/run/current-system") current_system_path = os.path.realpath("/run/current-system")
result = subprocess.run( result = subprocess.run(
["/run/current-system/sw/bin/nixos-rebuild", "build", "--flake", "/etc/nixos", "--no-build-output"], ["/run/current-system/sw/bin/nixos-rebuild", "build", "--flake", "/etc/nixos",
"--no-build-output", "--print-out-paths"],
capture_output=True, text=True, timeout=600, capture_output=True, text=True, timeout=600,
) )
if result.returncode == 0: if result.returncode == 0:
# nixos-rebuild build creates ./result symlink in cwd expected_system_path = result.stdout.strip()
result_path = os.path.realpath("result")
expected_system_path = result_path
system_matches = (current_system_path == expected_system_path) system_matches = (current_system_path == expected_system_path)
except subprocess.TimeoutExpired: except subprocess.TimeoutExpired:
expected_system_path = "Build timed out" expected_system_path = "Build timed out"