remove unused overlays
This commit is contained in:
parent
fb2a0df0a8
commit
d9f929f136
4 changed files with 0 additions and 110 deletions
|
@ -1,13 +0,0 @@
|
|||
{ ... }:
|
||||
let
|
||||
finalVersion = "1.22.5";
|
||||
in
|
||||
final: prev: {
|
||||
go_1_22 = prev.go_1_22.overrideAttrs (oldAttrs: {
|
||||
version = finalVersion;
|
||||
src = prev.fetchurl {
|
||||
url = "https://go.dev/dl/go${finalVersion}.src.tar.gz";
|
||||
hash = "sha256-rJxyPyJJaa7mJLw0/TTJ4T8qIS11xxyAfeZEu0bhEvY=";
|
||||
};
|
||||
});
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
{ lib, ...}:
|
||||
let
|
||||
versions = lib.importJSON ./versions.json;
|
||||
in
|
||||
final: prev: {
|
||||
warp-terminal = prev.warp-terminal.overrideAttrs (oldAttrs: {
|
||||
inherit (versions.linux) version;
|
||||
src = prev.fetchurl {
|
||||
url = "https://releases.warp.dev/stable/v${versions.linux.version}/warp-terminal-v${versions.linux.version}-1-x86_64.pkg.tar.zst";
|
||||
inherit (versions.linux) hash;
|
||||
};
|
||||
});
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p cacert curl jq nix moreutils --pure
|
||||
#shellcheck shell=bash
|
||||
set -eu -o pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
nixpkgs=$(nix-instantiate --eval -E '<nixpkgs>' --impure)
|
||||
|
||||
err() {
|
||||
echo "$*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
json_get() {
|
||||
jq -r "$1" < "./versions.json"
|
||||
}
|
||||
|
||||
json_set() {
|
||||
jq --arg x "$2" "$1 = \$x" < "./versions.json" | sponge "./versions.json"
|
||||
}
|
||||
|
||||
resolve_url() {
|
||||
local pkg sfx url
|
||||
local -i i max_redirects
|
||||
case "$1" in
|
||||
darwin)
|
||||
pkg=macos
|
||||
sfx=dmg
|
||||
;;
|
||||
linux)
|
||||
pkg=pacman
|
||||
sfx=pkg.tar.zst
|
||||
;;
|
||||
*)
|
||||
err "Unexpected download type: $1"
|
||||
;;
|
||||
esac
|
||||
url="https://app.warp.dev/download?package=${pkg}"
|
||||
((max_redirects = 15))
|
||||
for ((i = 0; i < max_redirects; i++)); do
|
||||
url=$(curl -s -o /dev/null -w '%{redirect_url}' "${url}")
|
||||
[[ ${url} != *.${sfx} ]] || break
|
||||
done
|
||||
((i < max_redirects)) || { err "too many redirects"; }
|
||||
echo "${url}"
|
||||
}
|
||||
|
||||
get_version() {
|
||||
echo "$1" | grep -oP -m 1 '(?<=/v)[\d.\w]+(?=/)'
|
||||
}
|
||||
|
||||
# nix-prefetch-url seems to be uncompressing the archive then taking the hash
|
||||
# so just get the hash from fetchurl
|
||||
sri_get() {
|
||||
local ouput sri
|
||||
output=$(nix-build --expr \
|
||||
"with import $nixpkgs {};
|
||||
fetchurl {
|
||||
url = \"$1\";
|
||||
}" 2>&1 || true)
|
||||
sri=$(echo "$output" | awk '/^\s+got:\s+/{ print $2 }')
|
||||
[[ -z "$sri" ]] && err "$output"
|
||||
echo "$sri"
|
||||
}
|
||||
|
||||
for sys in darwin linux; do
|
||||
url=$(resolve_url ${sys})
|
||||
version=$(get_version "${url}")
|
||||
if [[ ${version} != "$(json_get ".${sys}.version")" ]]; then
|
||||
sri=$(sri_get "${url}")
|
||||
json_set ".${sys}.version" "${version}"
|
||||
json_set ".${sys}.hash" "${sri}"
|
||||
fi
|
||||
done
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"darwin": {
|
||||
"hash": "sha256-vogQAVbtiw2/U3oJrTj8SUexkEsEfYvmGq50nzy5aYo=",
|
||||
"version": "0.2024.06.25.08.02.stable_01"
|
||||
},
|
||||
"linux": {
|
||||
"hash": "sha256-Fc48bZzFBw9p636Mr8R+W/d1B3kIcOAu/Gd17nbzNfI=",
|
||||
"version": "0.2024.06.25.08.02.stable_01"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue