diff --git a/nix_update/eval.py b/nix_update/eval.py index a5700bf..fb6c0f6 100644 --- a/nix_update/eval.py +++ b/nix_update/eval.py @@ -102,7 +102,8 @@ def eval_expression( inherit (flake) outPath; outPathLen = stringLength outPath; sanitizePosition = {{ file, ... }}@pos: - assert substring 0 outPathLen file == outPath; + assert substring 0 outPathLen file != outPath + -> throw "${{file}} is not in ${{outPath}}"; pos // {{ file = "{import_path}" + substring outPathLen (stringLength file - outPathLen) file; }}; """ else: