mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
fixed hash recipe
This commit is contained in:
parent
c257b8508f
commit
4e6a717ec7
1 changed files with 9 additions and 6 deletions
15
justfile
15
justfile
|
|
@ -108,21 +108,24 @@ boot:
|
||||||
@sudo nixos-rebuild boot --flake .#{{SYSTEM}}
|
@sudo nixos-rebuild boot --flake .#{{SYSTEM}}
|
||||||
|
|
||||||
# Commit all changes and push to upstream
|
# Commit all changes and push to upstream
|
||||||
gh MESSAGE:
|
gh COMMIT_MESSAGE:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "{{MESSAGE}}"
|
git commit -m "{{COMMIT_MESSAGE}}"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
#Fetch resources and compute sha256 hash
|
#Fetch resources and compute sha256 hash
|
||||||
hash URL:
|
hash URL:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if echo "{{URL}}" | grep -E '\.(tar\.gz|tgz|zip)$'; then
|
if echo "{{URL}}" | grep -E '\.(tar\.gz|tgz|zip)$'; then
|
||||||
CONTENTS=$(nix-prefetch-url --unpack "{{URL}}")
|
CONTENTS=$(nix-prefetch-url --unpack {{URL}} | tail -n 1)
|
||||||
else
|
else
|
||||||
CONTENTS=$(nix-prefetch-url "{{URL}}")
|
CONTENTS=$(nix-prefetch-url {{URL}} | tail -n 1)
|
||||||
fi
|
fi
|
||||||
HASH=$(echo -n "$CONTENTS" | nix hash to-sri --type sha256)
|
|
||||||
echo "$HASH"
|
HASH=$(nix hash to-sri --type sha256 "$CONTENTS")
|
||||||
|
|
||||||
|
echo -e "\033[32m$HASH\033[0m"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue