mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
fix(scripts): remove nix substitutions from shell script
This commit is contained in:
parent
2bed4190a4
commit
a458a21c7b
2 changed files with 17 additions and 11 deletions
22
flake.nix
22
flake.nix
|
|
@ -116,14 +116,20 @@
|
|||
};
|
||||
copyToRoot = pkgs.buildEnv {
|
||||
name = "image-root";
|
||||
paths = [
|
||||
pkgs.gitMinimal
|
||||
pkgs.gnugrep
|
||||
pkgs.cachix
|
||||
pkgs.attic-client
|
||||
setupScript
|
||||
finalizeScript
|
||||
];
|
||||
paths = with pkgs;
|
||||
[
|
||||
gitMinimal
|
||||
gnugrep
|
||||
gnused
|
||||
busybox
|
||||
diffutils
|
||||
cachix
|
||||
attic-client
|
||||
]
|
||||
++ [
|
||||
setupScript
|
||||
finalizeScript
|
||||
];
|
||||
pathsToLink = ["/bin"];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
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
|
||||
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="" \
|
||||
/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
|
||||
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")
|
||||
export RUNNER_CACHE=''${RUNNER_CACHE:-"file://$(pwd)/.nix-cache"}
|
||||
# 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 push --stdin ci:$ATTIC_CACHE || true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue