chore: rename env variables back to non-_ versions

for testing, CI template still needs adjustments
This commit is contained in:
technofab 2025-03-04 14:29:22 +01:00
parent 060d8fad47
commit a63376edf1
2 changed files with 11 additions and 11 deletions

View file

@ -92,9 +92,9 @@
echo -e "\\e[0Ksection_start:`date +%s`:nix_setup\\r\\e[0KSetting up Nix CI" echo -e "\\e[0Ksection_start:`date +%s`:nix_setup\\r\\e[0KSetting up Nix CI"
nix path-info --all > /tmp/nix-store-before nix path-info --all > /tmp/nix-store-before
if [ -z "$_NIX_CI_DISABLE_CACHE" ]; then if [ -z "$NIX_CI_DISABLE_CACHE" ]; then
echo -e "\\e[0Ksection_start:`date +%s`:cache_setup[collapsed=true]\\r\\e[0KConfiguring cache ($_NIX_CI_CACHE_STRATEGY)" echo -e "\\e[0Ksection_start:`date +%s`:cache_setup[collapsed=true]\\r\\e[0KConfiguring cache ($NIX_CI_CACHE_STRATEGY)"
case "$_NIX_CI_CACHE_STRATEGY" in case "$NIX_CI_CACHE_STRATEGY" in
"runner") "runner")
export RUNNER_CACHE=''${RUNNER_CACHE:-"file://$(pwd)/.nix-cache"} export RUNNER_CACHE=''${RUNNER_CACHE:-"file://$(pwd)/.nix-cache"}
echo "Runner Cache: $RUNNER_CACHE" echo "Runner Cache: $RUNNER_CACHE"
@ -116,7 +116,7 @@
echo "Cache strategy is none, doing nothing..." echo "Cache strategy is none, doing nothing..."
;; ;;
*) *)
echo "WARNING: Invalid cache strategy set: '$_NIX_CI_CACHE_STRATEGY'" echo "WARNING: Invalid cache strategy set: '$NIX_CI_CACHE_STRATEGY'"
;; ;;
esac esac
echo -e "\\e[0Ksection_end:`date +%s`:cache_setup\\r\\e[0K" echo -e "\\e[0Ksection_end:`date +%s`:cache_setup\\r\\e[0K"
@ -141,10 +141,10 @@
--old-line-format="" --unchanged-line-format="" \ --old-line-format="" --unchanged-line-format="" \
/tmp/nix-store-before /tmp/nix-store-after) /tmp/nix-store-before /tmp/nix-store-after)
COUNT=$(${pkgs.busybox}/bin/wc -l <<<"$NEW_PATHS") COUNT=$(${pkgs.busybox}/bin/wc -l <<<"$NEW_PATHS")
if [ -z "$_NIX_CI_DISABLE_CACHE" ]; then if [ -z "$NIX_CI_DISABLE_CACHE" ]; then
echo -e "\\e[0Ksection_start:`date +%s`:cache_push[collapsed=true]\\r\\e[0KPushing $COUNT new store paths to cache ($_NIX_CI_CACHE_STRATEGY)" echo -e "\\e[0Ksection_start:`date +%s`:cache_push[collapsed=true]\\r\\e[0KPushing $COUNT new store paths to cache ($NIX_CI_CACHE_STRATEGY)"
echo $NEW_PATHS | { echo $NEW_PATHS | {
case "$_NIX_CI_CACHE_STRATEGY" in case "$NIX_CI_CACHE_STRATEGY" in
"runner") "runner")
export RUNNER_CACHE=''${RUNNER_CACHE:-"file://$(pwd)/.nix-cache"} export RUNNER_CACHE=''${RUNNER_CACHE:-"file://$(pwd)/.nix-cache"}
# add ^* to all store paths ending in .drv (prevent warning log spam) # add ^* to all store paths ending in .drv (prevent warning log spam)
@ -160,7 +160,7 @@
echo "Cache strategy is none, doing nothing..." echo "Cache strategy is none, doing nothing..."
;; ;;
*) *)
echo "WARNING: Invalid cache strategy set: '$_NIX_CI_CACHE_STRATEGY'" echo "WARNING: Invalid cache strategy set: '$NIX_CI_CACHE_STRATEGY'"
;; ;;
esac esac
} }

View file

@ -25,7 +25,7 @@
}; };
configType = subType { configType = subType {
nix-jobs-per-default = mkOption { nix-jobs-by-default = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Handle jobs nix-based by default or via opt-in (in a job set nix.enable = true) if false"; description = "Handle jobs nix-based by default or via opt-in (in a job set nix.enable = true) if false";
@ -73,7 +73,7 @@
}; };
image = mkOption { image = mkOption {
type = types.str; type = types.str;
default = "$_NIX_CI_IMAGE"; default = "$NIX_CI_IMAGE";
}; };
after_script = mkNullOption (types.listOf types.str); after_script = mkNullOption (types.listOf types.str);
allow_failure = mkNullOption (types.either types.attrs types.bool); allow_failure = mkNullOption (types.either types.attrs types.bool);
@ -258,7 +258,7 @@
variables = variables =
(filterJobVariables false job) (filterJobVariables false job)
// lib.optionalAttrs job.nix.enable-runner-cache { // lib.optionalAttrs job.nix.enable-runner-cache {
_NIX_CI_CACHE_STRATEGY = "runner"; NIX_CI_CACHE_STRATEGY = "runner";
}; };
cache = cache =
( (