Loading pkgs/by-name/ya/yazi-unwrapped/package.nix +22 −26 Original line number Diff line number Diff line Loading @@ -8,33 +8,13 @@ Foundation, rust-jemalloc-sys, }: let rustPlatform.buildRustPackage (finalAttrs: { pname = "yazi"; version = "25.2.26"; code_src = fetchFromGitHub { owner = "sxyazi"; repo = "yazi"; tag = "v${version}"; hash = "sha256-DqhqpQRCSBTGonL9+bP7pA3mO2CemlbhwzShVdrL1/0="; }; man_src = fetchFromGitHub { name = "manpages"; # needed to ensure name is unique owner = "yazi-rs"; repo = "manpages"; rev = "8950e968f4a1ad0b83d5836ec54a070855068dbf"; hash = "sha256-kEVXejDg4ChFoMNBvKlwdFEyUuTcY2VuK9j0PdafKus="; }; in rustPlatform.buildRustPackage rec { pname = "yazi"; inherit version; srcs = builtins.attrValues finalAttrs.passthru.srcs; srcs = [ code_src man_src ]; sourceRoot = code_src.name; sourceRoot = finalAttrs.passthru.srcs.code_src.name; useFetchCargoVendor = true; cargoHash = "sha256-xg37aypFKY0ZG9GOkygTHlOAjqkTuhLNKo8Fz6MF2ZY="; Loading @@ -52,13 +32,29 @@ rustPlatform.buildRustPackage rec { --fish ./yazi-boot/completions/yazi.fish \ --zsh ./yazi-boot/completions/_yazi installManPage ../${man_src.name}/yazi{.1,-config.5} installManPage ../${finalAttrs.passthru.srcs.man_src.name}/yazi{.1,-config.5} install -Dm444 assets/yazi.desktop -t $out/share/applications install -Dm444 assets/logo.png $out/share/pixmaps/yazi.png ''; passthru.updateScript.command = [ ./update.sh ]; passthru.srcs = { code_src = fetchFromGitHub { owner = "sxyazi"; repo = "yazi"; tag = "v${finalAttrs.version}"; hash = "sha256-DqhqpQRCSBTGonL9+bP7pA3mO2CemlbhwzShVdrL1/0="; }; man_src = fetchFromGitHub { name = "manpages"; # needed to ensure name is unique owner = "yazi-rs"; repo = "manpages"; rev = "8950e968f4a1ad0b83d5836ec54a070855068dbf"; hash = "sha256-kEVXejDg4ChFoMNBvKlwdFEyUuTcY2VuK9j0PdafKus="; }; }; meta = { description = "Blazing fast terminal file manager written in Rust, based on async I/O"; Loading @@ -74,4 +70,4 @@ rustPlatform.buildRustPackage rec { ]; mainProgram = "yazi"; }; } }) pkgs/by-name/ya/yazi-unwrapped/update.sh +19 −8 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #!nix-shell -i bash -p bash nix-update curl coreutils jq common-updater-scripts nix-prefetch #!nix-shell -i bash -p bash nix-update curl coreutils jq common-updater-scripts gawk set -eux Loading @@ -26,16 +26,27 @@ if [[ "$oldVersion" == "$latestVersion" ]]; then exit 0 fi echo "Updating Yazi" echo "Updating code sources" # Version update-source-version yazi-unwrapped "${latestVersion}" update-source-version yazi-unwrapped "${latestVersion}" --source-key=passthru.srcs.code_src pushd "$SCRIPT_DIR" # Build date echo "Updating build date" sed -i 's#env.VERGEN_BUILD_DATE = "[^"]*"#env.VERGEN_BUILD_DATE = "'"${latestBuildDate}"'"#' package.nix # Hashes cargoHash=$(nix-prefetch "{ sha256 }: (import $NIXPKGS_DIR {}).yazi-unwrapped.cargoDeps.overrideAttrs (_: { outputHash = sha256; })") sed -i -E 's#\bcargoHash = ".*?"#cargoHash = "'"$cargoHash"'"#' package.nix echo "Updating cargoHash" # Set cargoHash to an empty string sed -i -E 's/cargoHash = ".*?"/cargoHash = ""/' package.nix # Build and get new hash cargoHash=$( (nix-build "$NIXPKGS_DIR" -A yazi-unwrapped 2>&1 || true) | awk '/got/{print $2}') if [ "$cargoHash" == "" ]; then echo "Failed to get cargoHash, please update it manually" exit 0 fi sed -i -E 's/cargoHash = ".*?"/cargoHash = "'"$cargoHash"'"/' package.nix popd Loading
pkgs/by-name/ya/yazi-unwrapped/package.nix +22 −26 Original line number Diff line number Diff line Loading @@ -8,33 +8,13 @@ Foundation, rust-jemalloc-sys, }: let rustPlatform.buildRustPackage (finalAttrs: { pname = "yazi"; version = "25.2.26"; code_src = fetchFromGitHub { owner = "sxyazi"; repo = "yazi"; tag = "v${version}"; hash = "sha256-DqhqpQRCSBTGonL9+bP7pA3mO2CemlbhwzShVdrL1/0="; }; man_src = fetchFromGitHub { name = "manpages"; # needed to ensure name is unique owner = "yazi-rs"; repo = "manpages"; rev = "8950e968f4a1ad0b83d5836ec54a070855068dbf"; hash = "sha256-kEVXejDg4ChFoMNBvKlwdFEyUuTcY2VuK9j0PdafKus="; }; in rustPlatform.buildRustPackage rec { pname = "yazi"; inherit version; srcs = builtins.attrValues finalAttrs.passthru.srcs; srcs = [ code_src man_src ]; sourceRoot = code_src.name; sourceRoot = finalAttrs.passthru.srcs.code_src.name; useFetchCargoVendor = true; cargoHash = "sha256-xg37aypFKY0ZG9GOkygTHlOAjqkTuhLNKo8Fz6MF2ZY="; Loading @@ -52,13 +32,29 @@ rustPlatform.buildRustPackage rec { --fish ./yazi-boot/completions/yazi.fish \ --zsh ./yazi-boot/completions/_yazi installManPage ../${man_src.name}/yazi{.1,-config.5} installManPage ../${finalAttrs.passthru.srcs.man_src.name}/yazi{.1,-config.5} install -Dm444 assets/yazi.desktop -t $out/share/applications install -Dm444 assets/logo.png $out/share/pixmaps/yazi.png ''; passthru.updateScript.command = [ ./update.sh ]; passthru.srcs = { code_src = fetchFromGitHub { owner = "sxyazi"; repo = "yazi"; tag = "v${finalAttrs.version}"; hash = "sha256-DqhqpQRCSBTGonL9+bP7pA3mO2CemlbhwzShVdrL1/0="; }; man_src = fetchFromGitHub { name = "manpages"; # needed to ensure name is unique owner = "yazi-rs"; repo = "manpages"; rev = "8950e968f4a1ad0b83d5836ec54a070855068dbf"; hash = "sha256-kEVXejDg4ChFoMNBvKlwdFEyUuTcY2VuK9j0PdafKus="; }; }; meta = { description = "Blazing fast terminal file manager written in Rust, based on async I/O"; Loading @@ -74,4 +70,4 @@ rustPlatform.buildRustPackage rec { ]; mainProgram = "yazi"; }; } })
pkgs/by-name/ya/yazi-unwrapped/update.sh +19 −8 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #!nix-shell -i bash -p bash nix-update curl coreutils jq common-updater-scripts nix-prefetch #!nix-shell -i bash -p bash nix-update curl coreutils jq common-updater-scripts gawk set -eux Loading @@ -26,16 +26,27 @@ if [[ "$oldVersion" == "$latestVersion" ]]; then exit 0 fi echo "Updating Yazi" echo "Updating code sources" # Version update-source-version yazi-unwrapped "${latestVersion}" update-source-version yazi-unwrapped "${latestVersion}" --source-key=passthru.srcs.code_src pushd "$SCRIPT_DIR" # Build date echo "Updating build date" sed -i 's#env.VERGEN_BUILD_DATE = "[^"]*"#env.VERGEN_BUILD_DATE = "'"${latestBuildDate}"'"#' package.nix # Hashes cargoHash=$(nix-prefetch "{ sha256 }: (import $NIXPKGS_DIR {}).yazi-unwrapped.cargoDeps.overrideAttrs (_: { outputHash = sha256; })") sed -i -E 's#\bcargoHash = ".*?"#cargoHash = "'"$cargoHash"'"#' package.nix echo "Updating cargoHash" # Set cargoHash to an empty string sed -i -E 's/cargoHash = ".*?"/cargoHash = ""/' package.nix # Build and get new hash cargoHash=$( (nix-build "$NIXPKGS_DIR" -A yazi-unwrapped 2>&1 || true) | awk '/got/{print $2}') if [ "$cargoHash" == "" ]; then echo "Failed to get cargoHash, please update it manually" exit 0 fi sed -i -E 's/cargoHash = ".*?"/cargoHash = "'"$cargoHash"'"/' package.nix popd