From fc5c9c6c1ea82e4699ac3aa3ee7b2c0ab79e7653 Mon Sep 17 00:00:00 2001 From: Quinn Unger Date: Fri, 10 Jul 2026 15:27:21 +0100 Subject: [PATCH] support provider patches (#12) --- lib/importCore.nix | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/importCore.nix b/lib/importCore.nix index ba9289f..40b1f53 100644 --- a/lib/importCore.nix +++ b/lib/importCore.nix @@ -76,6 +76,7 @@ lib.extendMkDerivation { src = if useProvider then fetchProvider finalAttrs.passthru.core providerHash else coreRoot; installPhase = let + patches = core.provider.patches or [ ]; patchedCore = let inherit (finalAttrs.passthru) core; @@ -85,23 +86,25 @@ lib.extendMkDerivation { // { provider = { name = "local"; - patches = core.provider.patches or [ ]; + inherit patches; }; } else core; + copyFromPwd = + dir: + lib.concatStringsSep "\n" ( + map (file: '' + mkdir -p $out/${dirOf file} + cp ${file} $out/${file} + '') dir + ); in - lib.concatStringsSep "\n" ( - (map (file: '' - mkdir -p $out/${dirOf file} - cp ${file} $out/${file} - '') coreFileset) - ++ [ - '' - mkdir -p $out/ - cp ${(formats.yaml { }).generate coreName patchedCore} $out/${coreName} - '' - ] - ); + '' + mkdir -p $out/ + ${copyFromPwd coreFileset} + cp ${(formats.yaml { }).generate coreName patchedCore} $out/${coreName} + ${if useProvider then "cd ${coreRoot}\n${copyFromPwd patches}" else ""} + ''; }; } -- 2.51.2