flake: fix privateInputs loading in nix store contexts

When clan-core is fetched via fetchgit (e.g. in tests), the devFlake/private
directory exists but cannot be loaded as a flake. This causes errors when
building test machines.

Fix by:
1. Adding a .skip-private-inputs marker file in clan-core-for-checks to
   explicitly disable private inputs in test contexts
2. Checking for this marker file before attempting to load private inputs
3. Keeping the original tryEval approach as a fallback for compatibility

This ensures tests can run without errors while preserving the ability to
load private inputs in development environments.
This commit is contained in:
Jörg Thalheim
2025-07-29 14:58:29 +02:00
parent ae0ea37437
commit e99981cfaf
2 changed files with 12 additions and 2 deletions

View File

@@ -50,6 +50,7 @@
pathExists
;
# Load private flake inputs if available
loadDevFlake =
path:
let
@@ -60,7 +61,13 @@
devFlake = builtins.tryEval (loadDevFlake ./devFlake/private);
privateInputs = if devFlake.success then devFlake.value.inputs else { };
privateInputs =
if pathExists ./.skip-private-inputs then
{ }
else if devFlake.success then
devFlake.value.inputs
else
{ };
in
flake-parts.lib.mkFlake { inherit inputs; } (
{ ... }: