fix unlocked flake.lock in tests

This commit is contained in:
Jörg Thalheim
2025-06-28 08:50:29 +02:00
parent 65ee951b72
commit 43df2c9a14
2 changed files with 27 additions and 9 deletions

View File

@@ -158,14 +158,26 @@ in
'';
# the test's flake.nix with locked clan-core input
flakeForSandbox = hostPkgs.runCommand "offline-flake-for-test-${config.name}" { } ''
cp -r ${config.clan.directory} $out
chmod +w -R $out
substituteInPlace $out/flake.nix \
--replace-fail \
"https://git.clan.lol/clan/clan-core/archive/main.tar.gz" \
"${clan-core.packages.${hostPkgs.system}.clan-core-flake}"
'';
flakeForSandbox =
hostPkgs.runCommand "offline-flake-for-test-${config.name}"
{
nativeBuildInputs = [ hostPkgs.nix ];
}
''
cp -r ${config.clan.directory} $out
chmod +w -R $out
substituteInPlace $out/flake.nix \
--replace-fail \
"https://git.clan.lol/clan/clan-core/archive/main.tar.gz" \
"${clan-core.packages.${hostPkgs.system}.clan-core-flake}"
# Create a proper lock file for the test flake
export HOME=$(mktemp -d)
nix flake lock $out \
--extra-experimental-features 'nix-command flakes' \
--override-input clan-core ${clan-core.packages.${hostPkgs.system}.clan-core-flake} \
--override-input nixpkgs ${clan-core.inputs.nixpkgs}
'';
in
{
imports = [