nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

urbit: remove old urbit; init at 1.20

+70 -17
+6
maintainers/maintainer-list.nix
··· 9183 9183 githubId = 952712; 9184 9184 name = "Matt Christ"; 9185 9185 }; 9186 + matthew-levan = { 9187 + email = "matthew@coeli.network"; 9188 + github = "matthew-levan"; 9189 + githubId = 91502660; 9190 + name = "Matthew LeVan"; 9191 + }; 9186 9192 matthewcroughan = { 9187 9193 email = "matt@croughan.sh"; 9188 9194 github = "MatthewCroughan";
+24 -17
pkgs/misc/urbit/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, curl, git, gmp, libsigsegv, meson, ncurses, ninja 2 - , openssl, pkg-config, re2c, zlib 1 + { stdenv 2 + , lib 3 + , fetchzip 3 4 }: 4 5 6 + let 7 + os = if stdenv.isDarwin then "macos" else "linux"; 8 + arch = if stdenv.isAarch64 then "aarch64" else "x86_64"; 9 + platform = "${os}-${arch}"; 10 + in 5 11 stdenv.mkDerivation rec { 6 12 pname = "urbit"; 7 - version = "0.7.3"; 13 + version = "1.20"; 8 14 9 - src = fetchFromGitHub { 10 - owner = "urbit"; 11 - repo = "urbit"; 12 - rev = "v${version}"; 13 - sha256 = "192843pjzh8z55fd0x70m3l1vncmixljia3nphgn7j7x4976xkp2"; 14 - fetchSubmodules = true; 15 + src = fetchzip { 16 + url = "https://github.com/urbit/vere/releases/download/vere-v${version}/${platform}.tgz"; 17 + sha256 = { 18 + x86_64-linux = "sha256-nBIpf9akK4cXnR5y5Fcl1g7/FxL8BU/CH/WHGhYuP74="; 19 + aarch64-linux = "sha256-ERSYXNh/vmAKr4PNonOxTm5/FRLNDWwHSHM6fIeY4Nc="; 20 + x86_64-darwin = "sha256-Kk9hNzyWngnyqlyQ9hILFM81WVw1ZYimMj4K3ENtifE="; 21 + aarch64-darwin = "sha256-i3ixj04J/fcb396ncINLF8eYw1mpFCYeIM3f74K6tqY="; 22 + }.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"); 15 23 }; 16 24 17 - nativeBuildInputs = [ pkg-config ninja meson ]; 18 - buildInputs = [ curl git gmp libsigsegv ncurses openssl re2c zlib ]; 19 - 20 - postPatch = '' 21 - patchShebangs . 25 + postInstall = '' 26 + install -m755 -D vere-v${version}-${platform} $out/bin/urbit 22 27 ''; 23 28 29 + passthru.updateScript = ./update-bin.sh; 30 + 24 31 meta = with lib; { 25 - description = "An operating function"; 26 32 homepage = "https://urbit.org"; 33 + description = "An operating function"; 34 + platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; 35 + maintainers = [ maintainers.matthew-levan ]; 27 36 license = licenses.mit; 28 - maintainers = with maintainers; [ mudri ]; 29 - platforms = with platforms; linux; 30 37 }; 31 38 }
+40
pkgs/misc/urbit/update-bin.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p curl common-updater-scripts nix-prefetch 3 + 4 + set -euo pipefail 5 + 6 + ROOT="$(dirname "$(readlink -f "$0")")" 7 + NIX_DRV="$ROOT/default.nix" 8 + if [ ! -f "$NIX_DRV" ]; then 9 + echo "ERROR: cannot find urbit in $ROOT" 10 + exit 1 11 + fi 12 + 13 + fetch_arch() { 14 + VER="$1"; ARCH="$2" 15 + URL="https://github.com/urbit/vere/releases/download/vere-v${VER}/${ARCH}.tgz"; 16 + nix-prefetch "{ stdenv, fetchzip }: 17 + stdenv.mkDerivation rec { 18 + pname = \"vere\"; version = \"${VER}\"; 19 + src = fetchzip { url = \"$URL\"; }; 20 + } 21 + " 22 + } 23 + 24 + replace_sha() { 25 + sed -i "s#$1 = \"sha256-.\{44\}\"#$1 = \"$2\"#" "$NIX_DRV" 26 + } 27 + 28 + VERE_VER=$(curl https://bootstrap.urbit.org/vere/live/last) 29 + 30 + VERE_LINUX_AARCH64_SHA256=$(fetch_arch "$VERE_VER" "linux-aarch64") 31 + VERE_LINUX_X64_SHA256=$(fetch_arch "$VERE_VER" "linux-x86_64") 32 + VERE_DARWIN_AARCH64_SHA256=$(fetch_arch "$VERE_VER" "macos-aarch64") 33 + VERE_DARWIN_X64_SHA256=$(fetch_arch "$VERE_VER" "macos-x86_64") 34 + 35 + sed -i "s/version = \".*\"/version = \"$VERE_VER\"/" "$NIX_DRV" 36 + 37 + replace_sha "aarch64-linux" "$VERE_LINUX_AARCH64_SHA256" 38 + replace_sha "x86_64-linux" "$VERE_LINUX_X64_SHA256" 39 + replace_sha "aarch64-darwin" "$VERE_DARWIN_AARCH64_SHA256" 40 + replace_sha "x86_64-darwin" "$VERE_DARWIN_X64_SHA256"