nix: only use stable commands

Avoid the following error when installing nix-unstable:

    experimental Nix feature 'nix-command' is disabled; use '--experimental-features nix-command' to override
This commit is contained in:
zimbatm 2021-01-25 10:39:33 +01:00
commit 9831d0f47e
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
4 changed files with 22 additions and 3 deletions

2
dist/main/index.js vendored
View file

@ -1072,7 +1072,7 @@ function setup() {
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
}
// Remember existing store paths
yield exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' > /tmp/store-path-pre-build`]);
yield exec.exec("sh", ["-c", `${__dirname}/list-nix-store.sh > /tmp/store-path-pre-build`]);
}
catch (error) {
core.setFailed(`Action failed with error: ${error}`);

19
dist/main/list-nix-store.sh vendored Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Small utility to replace `nix path-info --all`
set -euo pipefail
for file in /nix/store/*; do
case "$file" in
*.drv)
# Avoid .drv as they are not generally useful
continue
;;
*.check)
# Skip .check file produced by --keep-failed
continue
;;
*)
echo "$file"
;;
esac
done

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -euo pipefail
comm -13 <(sort /tmp/store-path-pre-build) <(nix path-info --all | grep -v '\.drv$' | sort) | $1 push -j8 $2
comm -13 <(sort /tmp/store-path-pre-build) <("$(dirname "$0")"/list-nix-store.sh) | "$1" push -j8 "$2"