-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f62f52
commit 978b2c5
Showing
3 changed files
with
61 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Credits to https://github.com/cachix/cachix-action/blob/master/dist/main/list-nix-store.sh | ||
|
||
# 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 | ||
;; | ||
*.drv.chroot) | ||
# Avoid .drv.chroot as they are not generally useful | ||
continue | ||
;; | ||
*.check) | ||
# Skip .check file produced by --keep-failed | ||
continue | ||
;; | ||
*.lock) | ||
# Skip .lock files | ||
continue | ||
;; | ||
*) | ||
echo "$file" | ||
;; | ||
esac | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
# Credits to https://github.com/cachix/cachix-action/blob/master/dist/main/list-nix-store.sh | ||
set -euo pipefail | ||
|
||
cachix=$1 cachixArgs=${2:--j8} cache=$3 pathsToPush=$4 pushFilter=$5 | ||
|
||
if [[ $pathsToPush == "" ]]; then | ||
pathsToPush=$(comm -13 <(sort /tmp/store-path-pre-build) <("$(dirname "$0")"/list-nix-store.sh)) | ||
|
||
if [[ $pushFilter != "" ]]; then | ||
pathsToPush=$(echo "$pathsToPush" | grep -vEe "$pushFilter") | ||
fi | ||
fi | ||
|
||
echo "$pathsToPush" | "$cachix" push $cachixArgs "$cache" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters