From ecf55714fe2a863e378d360a50664c6c0bcd4135 Mon Sep 17 00:00:00 2001 From: Ameer Taweel Date: Tue, 28 Apr 2026 01:00:25 +0300 Subject: [PATCH] lib/sources: remove absolute path literals --- lib/sources.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/sources.nix b/lib/sources.nix index 230512bbaa77..43bc2ab2dbe3 100644 --- a/lib/sources.nix +++ b/lib/sources.nix @@ -311,7 +311,13 @@ let fileName = path + "/${file}"; packedRefsName = path + "/packed-refs"; absolutePath = - base: path: if lib.hasPrefix "/" path then path else toString (/. + "${base}/${path}"); + base: path: + if lib.hasPrefix "/" path then + path + else if lib.hasPrefix "/" base then + "${base}/${path}" + else + "/${base}/${path}"; in if pathIsRegularFile path