attic-client: 0-unstable-2025-07-01 -> 0-unstable-2025-07-08, use nix 2.28, fix updateScript (#423483)
This commit is contained in:
commit
4afcfbf983
@ -8,22 +8,26 @@
|
|||||||
pkg-config,
|
pkg-config,
|
||||||
stdenv,
|
stdenv,
|
||||||
installShellFiles,
|
installShellFiles,
|
||||||
|
nix-update-script,
|
||||||
crates ? [ "attic-client" ],
|
crates ? [ "attic-client" ],
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
# Only the attic-client crate builds against the Nix C++ libs
|
# Only the attic-client crate builds against the Nix C++ libs
|
||||||
# This derivation is also used to build the server
|
# This derivation is also used to build the server
|
||||||
needNixInclude = lib.elem "attic-client" crates;
|
needNixInclude = lib.elem "attic-client" crates;
|
||||||
|
nix = nixVersions.nix_2_28;
|
||||||
in
|
in
|
||||||
|
|
||||||
rustPlatform.buildRustPackage {
|
rustPlatform.buildRustPackage {
|
||||||
pname = "attic";
|
pname = "attic";
|
||||||
version = "0-unstable-2025-07-01";
|
version = "0-unstable-2025-07-08";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "zhaofengli";
|
owner = "zhaofengli";
|
||||||
repo = "attic";
|
repo = "attic";
|
||||||
rev = "896ad88fa57ad5dbcd267c0ac51f1b71ccfcb4dd";
|
rev = "07147da79388468ff85c2a650500d11ca0edd12e";
|
||||||
hash = "sha256-V0EPQNsQko1a8OqIWc2lLviLnMpR1m08Ej00z5RVTfs=";
|
hash = "sha256-pHsHcWQWGyzDh48YHnSw9YVKEnQ95QWnmHNFtvo7iu0=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
@ -31,21 +35,15 @@ rustPlatform.buildRustPackage {
|
|||||||
installShellFiles
|
installShellFiles
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = lib.optional needNixInclude nixVersions.nix_2_24 ++ [
|
buildInputs = lib.optional needNixInclude nix ++ [ boost ];
|
||||||
boost
|
|
||||||
];
|
|
||||||
|
|
||||||
cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates;
|
cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates;
|
||||||
cargoHash = "sha256-AbpWnYfBMrR6oOfy2LkQvIPYsClCWE89bJav+iHTtLM=";
|
cargoHash = "sha256-I5GS32dOCECYKSNMi2Xs2rBRxPLcvLEWHlIIWP/bMBU=";
|
||||||
useFetchCargoVendor = true;
|
useFetchCargoVendor = true;
|
||||||
|
|
||||||
env =
|
env = {
|
||||||
{
|
|
||||||
ATTIC_DISTRIBUTOR = "nixpkgs";
|
ATTIC_DISTRIBUTOR = "nixpkgs";
|
||||||
}
|
} // lib.optionalAttrs needNixInclude { NIX_INCLUDE_PATH = "${lib.getDev nix}/include"; };
|
||||||
// lib.optionalAttrs needNixInclude {
|
|
||||||
NIX_INCLUDE_PATH = "${lib.getDev nixVersions.nix_2_24}/include";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Attic interacts with Nix directly and its tests require trusted-user access
|
# Attic interacts with Nix directly and its tests require trusted-user access
|
||||||
# to nix-daemon to import NARs, which is not possible in the build sandbox.
|
# to nix-daemon to import NARs, which is not possible in the build sandbox.
|
||||||
@ -61,22 +59,21 @@ rustPlatform.buildRustPackage {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
tests = {
|
tests = { inherit (nixosTests) atticd; };
|
||||||
inherit (nixosTests) atticd;
|
|
||||||
|
updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
|
||||||
};
|
};
|
||||||
|
|
||||||
updateScript = ./update.sh;
|
meta = {
|
||||||
};
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
description = "Multi-tenant Nix Binary Cache";
|
description = "Multi-tenant Nix Binary Cache";
|
||||||
homepage = "https://github.com/zhaofengli/attic";
|
homepage = "https://github.com/zhaofengli/attic";
|
||||||
license = licenses.asl20;
|
license = lib.licenses.asl20;
|
||||||
maintainers = with maintainers; [
|
maintainers = with lib.maintainers; [
|
||||||
zhaofengli
|
zhaofengli
|
||||||
aciceri
|
aciceri
|
||||||
|
defelo
|
||||||
];
|
];
|
||||||
platforms = platforms.linux ++ platforms.darwin;
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
||||||
mainProgram = "attic";
|
mainProgram = "attic";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,40 +0,0 @@
|
|||||||
#!/usr/bin/env nix-shell
|
|
||||||
#!nix-shell -i bash -p wget nix-prefetch-github jq coreutils
|
|
||||||
|
|
||||||
# shellcheck shell=bash
|
|
||||||
|
|
||||||
if [ -n "$GITHUB_TOKEN" ]; then
|
|
||||||
TOKEN_ARGS=(--header "Authorization: token $GITHUB_TOKEN")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $# -gt 1 || $1 == -* ]]; then
|
|
||||||
echo "Regenerates packaging data for attic."
|
|
||||||
echo "Usage: $0 [git commit]"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
rev="$1"
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
if [ -z "$rev" ]; then
|
|
||||||
rev="$(wget -O- "${TOKEN_ARGS[@]}" "https://api.github.com/repos/zhaofengli/attic/commits?per_page=1" | jq -r '.[0].sha')"
|
|
||||||
fi
|
|
||||||
|
|
||||||
date="$(wget -O- "${TOKEN_ARGS[@]}" "https://api.github.com/repos/zhaofengli/attic/commits/$rev" | jq -r '.commit.author.date' | cut -dT -f1)"
|
|
||||||
|
|
||||||
version="0-unstable-$date"
|
|
||||||
|
|
||||||
# Sources
|
|
||||||
src_hash=$(nix-prefetch-github zhaofengli attic --rev "$rev" | jq -r .hash)
|
|
||||||
|
|
||||||
# Cargo.lock
|
|
||||||
src="https://raw.githubusercontent.com/zhaofengli/attic/$rev"
|
|
||||||
wget "${TOKEN_ARGS[@]}" "$src/Cargo.lock" -O Cargo.lock
|
|
||||||
|
|
||||||
sed -i -E -e "s#version = \".*\"#version = \"$version\"#" package.nix
|
|
||||||
sed -i -E -e "s#rev = \".*\"#rev = \"$rev\"#" package.nix
|
|
||||||
sed -i -E -e "s#hash = \".*\"#hash = \"$src_hash\"#" package.nix
|
|
||||||
Loading…
x
Reference in New Issue
Block a user