_1password-gui: Allow Linux and Darwin versions to move separately

This commit is contained in:
Berk D. Demir
2025-03-19 11:06:49 -07:00
parent 5d928bf499
commit 44914137eb
3 changed files with 12 additions and 14 deletions
@@ -12,7 +12,8 @@ let
pname = "1password";
versions = builtins.fromJSON (builtins.readFile ./versions.json);
inherit (versions.${channel} or (throw "unknown channel ${channel}")) version;
hostOs = if stdenv.hostPlatform.isLinux then "linux" else "darwin";
version = versions."${channel}-${hostOs}" or (throw "unknown channel-os ${channel}-${hostOs}");
sources = builtins.fromJSON (builtins.readFile ./sources.json);
@@ -42,12 +42,11 @@ cleanup() {
trap cleanup EXIT
# Get channel versions from versions.json
declare -A version=(
["stable"]=$(jq -r '.stable.version' versions.json)
["beta"]=$(jq -r '.beta.version' versions.json)
)
declare -A versions
while IFS='=' read -r key value; do
versions["${key}"]="${value}"
done < <(jq -r 'to_entries[] | "\(.key)=\(.value)"' versions.json)
#
GPG_KEYRING=$(mktemp -t 1password.kbx.XXXXXX)
gpg --no-default-keyring --keyring "${GPG_KEYRING}" \
--keyserver keyserver.ubuntu.com \
@@ -57,7 +56,8 @@ JSON_HEAP=$(mktemp -t 1password-gui.jsonheap.XXXXXX)
for channel in stable beta; do
for os in linux darwin; do
for arch in x86_64 aarch64; do
url=$(mk_url ${os} ${channel} ${arch} "${version[${channel}]}")
version="${versions[${channel}-${os}]}"
url=$(mk_url ${os} ${channel} ${arch} ${version})
nix store prefetch-file --json "${url}" | jq "
{
\"${channel}\": {
@@ -1,9 +1,6 @@
{
"stable": {
"version": "8.10.60"
},
"beta": {
"version": "8.10.68-12.BETA"
}
"stable-linux": "8.10.60",
"stable-darwin": "8.10.60",
"beta-linux":"8.10.68-12.BETA",
"beta-darwin": "8.10.68-12.BETA"
}