fix(scripts): remove nix substitutions from shell script

This commit is contained in:
technofab 2025-03-23 14:55:40 +01:00
parent 2bed4190a4
commit a458a21c7b
2 changed files with 17 additions and 11 deletions

View file

@ -116,14 +116,20 @@
}; };
copyToRoot = pkgs.buildEnv { copyToRoot = pkgs.buildEnv {
name = "image-root"; name = "image-root";
paths = [ paths = with pkgs;
pkgs.gitMinimal [
pkgs.gnugrep gitMinimal
pkgs.cachix gnugrep
pkgs.attic-client gnused
setupScript busybox
finalizeScript diffutils
]; cachix
attic-client
]
++ [
setupScript
finalizeScript
];
pathsToLink = ["/bin"]; pathsToLink = ["/bin"];
}; };
}; };

View file

@ -1,10 +1,10 @@
echo -e "\\e[0Ksection_start:`date +%s`:finalize_nix_ci[collapsed=true]\\r\\e[0KFinalizing Nix CI..." echo -e "\\e[0Ksection_start:`date +%s`:finalize_nix_ci[collapsed=true]\\r\\e[0KFinalizing Nix CI..."
nix path-info --all > /tmp/nix-store-after nix path-info --all > /tmp/nix-store-after
echo "Finding new paths..." echo "Finding new paths..."
NEW_PATHS=$(${pkgs.diffutils}/bin/diff --new-line-format="%L" \ NEW_PATHS=$(diff --new-line-format="%L" \
--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=$(wc -l <<<"$NEW_PATHS")
if [[ "$NIX_CI_CACHE_STRATEGY" == "auto" ]]; then if [[ "$NIX_CI_CACHE_STRATEGY" == "auto" ]]; then
export NIX_CI_CACHE_STRATEGY="${NIX_CI_RUNNER_CACHE_STRATEGY:-${NIX_CI_DEFAULT_CACHE_STRATEGY:-none}}"; export NIX_CI_CACHE_STRATEGY="${NIX_CI_RUNNER_CACHE_STRATEGY:-${NIX_CI_DEFAULT_CACHE_STRATEGY:-none}}";
@ -17,7 +17,7 @@ echo -e "\\e[0Ksection_start:`date +%s`:finalize_nix_ci[collapsed=true]\\r\\e[0K
"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)
${pkgs.gnused}/bin/sed '/\.drv$/s/$/^*/' | nix copy --quiet --to "$RUNNER_CACHE" --stdin || true sed '/\.drv$/s/$/^*/' | nix copy --quiet --to "$RUNNER_CACHE" --stdin || true
;; ;;
"attic") "attic")
attic push --stdin ci:$ATTIC_CACHE || true attic push --stdin ci:$ATTIC_CACHE || true