
This is done with the following bash script: ``` #!/usr/bin/env bash process_line() { local filename=${1%:} if [[ $4 =~ \"(.*)\"\; ]]; then local sha256="${BASH_REMATCH[1]}" fi [[ -z $sha256 ]] && return 0 local hash=$(nix hash to-sri --type sha256 $sha256) echo "Processing: $filename" echo " $sha256 => $hash" sed -i "s|cargoSha256 = \"$sha256\"|cargoHash = \"$hash\"|" $filename } # split output by line grep -r 'cargoSha256 = ' . | while IFS= read -r line; do # split them further by space read -r -a parts <<< "$line" process_line "${parts[@]}" done ```
27 lines
730 B
Nix
27 lines
730 B
Nix
{ fetchFromGitHub, rustPlatform, lib }:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "clog-cli";
|
|
version = "0.9.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "clog-tool";
|
|
repo = "clog-cli";
|
|
rev = "v${version}";
|
|
sha256 = "1wxglc4n1dar5qphhj5pab7ps34cjr7jy611fwn72lz0f6c7jp3z";
|
|
};
|
|
|
|
cargoHash = "sha256-yjBgccrkG2D8ZW3Uju4XUhz9Kar50jkJZ75MWhn9j3U=";
|
|
|
|
meta = {
|
|
description = "Generate changelogs from local git metadata";
|
|
homepage = "https://github.com/clog-tool/clog-cli";
|
|
license = lib.licenses.mit;
|
|
platforms = lib.platforms.unix;
|
|
maintainers = [lib.maintainers.nthorne];
|
|
mainProgram = "clog";
|
|
# error: could not compile `rustc-serialize`
|
|
broken = true; # Added 2024-03-16
|
|
};
|
|
}
|