clan-cli: Fix templates not downloading template, Make templates use Flake cache, Fix flake cache exception on conditional attribute, add more tests

This commit is contained in:
Qubasa
2025-03-17 14:31:53 +01:00
committed by Mic92
parent bc48a7a57c
commit 63a0e5f35d
13 changed files with 409 additions and 230 deletions

View File

@@ -15,6 +15,7 @@
inventory-schema-abstract,
classgen,
pythonRuntime,
templateDerivation,
}:
let
pyDeps = ps: [
@@ -128,7 +129,16 @@ pythonRuntime.pkgs.buildPythonApplication {
(lib.mapAttrs' (n: lib.nameValuePair "clan-dep-${n}") testRuntimeDependenciesMap)
// {
clan-pytest-without-core =
runCommand "clan-pytest-without-core" { nativeBuildInputs = testDependencies; }
runCommand "clan-pytest-without-core"
{
nativeBuildInputs = testDependencies;
closureInfo = pkgs.closureInfo {
rootPaths = [
templateDerivation
];
};
}
''
set -u -o pipefail
cp -r ${source} ./src
@@ -160,6 +170,7 @@ pythonRuntime.pkgs.buildPythonApplication {
];
closureInfo = pkgs.closureInfo {
rootPaths = [
templateDerivation
pkgs.bash
pkgs.coreutils
pkgs.jq.dev
@@ -175,6 +186,7 @@ pythonRuntime.pkgs.buildPythonApplication {
cd ./src
export CLAN_CORE=${clan-core-path}
export CLAN_CORE_PATH=${clan-core-path}
export NIX_STATE_DIR=$TMPDIR/nix
export IN_NIX_SANDBOX=1
export PYTHONWARNINGS=error