Merge pull request #167 from naturallaw777/copilot/fix-system-integrity-check

Fix: Running System Match always fails due to cwd-relative result symlink
This commit is contained in:
Sovran_Systems
2026-04-08 22:03:36 -05:00
committed by GitHub

View File

@@ -3088,13 +3088,12 @@ async def api_security_verify_integrity():
try:
current_system_path = os.path.realpath("/run/current-system")
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,
)
if result.returncode == 0:
# nixos-rebuild build creates ./result symlink in cwd
result_path = os.path.realpath("result")
expected_system_path = result_path
expected_system_path = result.stdout.strip()
system_matches = (current_system_path == expected_system_path)
except subprocess.TimeoutExpired:
expected_system_path = "Build timed out"