From d8f99c1c29af06aa3e50263838e46fe03b7c4b02 Mon Sep 17 00:00:00 2001 From: Defelo Date: Tue, 8 Jul 2025 15:19:04 +0200 Subject: [PATCH 1/5] attic-client: remove `with lib;` --- pkgs/by-name/at/attic-client/package.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/at/attic-client/package.nix b/pkgs/by-name/at/attic-client/package.nix index 5ba0bab1690c..3546ef4750d9 100644 --- a/pkgs/by-name/at/attic-client/package.nix +++ b/pkgs/by-name/at/attic-client/package.nix @@ -10,11 +10,13 @@ installShellFiles, crates ? [ "attic-client" ], }: + let # Only the attic-client crate builds against the Nix C++ libs # This derivation is also used to build the server needNixInclude = lib.elem "attic-client" crates; in + rustPlatform.buildRustPackage { pname = "attic"; version = "0-unstable-2025-07-01"; @@ -31,9 +33,7 @@ rustPlatform.buildRustPackage { installShellFiles ]; - buildInputs = lib.optional needNixInclude nixVersions.nix_2_24 ++ [ - boost - ]; + buildInputs = lib.optional needNixInclude nixVersions.nix_2_24 ++ [ boost ]; cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates; cargoHash = "sha256-AbpWnYfBMrR6oOfy2LkQvIPYsClCWE89bJav+iHTtLM="; @@ -61,22 +61,20 @@ rustPlatform.buildRustPackage { ''; passthru = { - tests = { - inherit (nixosTests) atticd; - }; + tests = { inherit (nixosTests) atticd; }; updateScript = ./update.sh; }; - meta = with lib; { + meta = { description = "Multi-tenant Nix Binary Cache"; homepage = "https://github.com/zhaofengli/attic"; - license = licenses.asl20; - maintainers = with maintainers; [ + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ zhaofengli aciceri ]; - platforms = platforms.linux ++ platforms.darwin; + platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "attic"; }; } From ff2863b4b1af7de4de6cad0afb87711231a82ac5 Mon Sep 17 00:00:00 2001 From: Defelo Date: Tue, 8 Jul 2025 15:19:57 +0200 Subject: [PATCH 2/5] attic-client: fix updateScript --- pkgs/by-name/at/attic-client/package.nix | 3 +- pkgs/by-name/at/attic-client/update.sh | 40 ------------------------ 2 files changed, 2 insertions(+), 41 deletions(-) delete mode 100755 pkgs/by-name/at/attic-client/update.sh diff --git a/pkgs/by-name/at/attic-client/package.nix b/pkgs/by-name/at/attic-client/package.nix index 3546ef4750d9..21bea8ebba4c 100644 --- a/pkgs/by-name/at/attic-client/package.nix +++ b/pkgs/by-name/at/attic-client/package.nix @@ -8,6 +8,7 @@ pkg-config, stdenv, installShellFiles, + nix-update-script, crates ? [ "attic-client" ], }: @@ -63,7 +64,7 @@ rustPlatform.buildRustPackage { passthru = { tests = { inherit (nixosTests) atticd; }; - updateScript = ./update.sh; + updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; }; meta = { diff --git a/pkgs/by-name/at/attic-client/update.sh b/pkgs/by-name/at/attic-client/update.sh deleted file mode 100755 index e6ec0ab1296b..000000000000 --- a/pkgs/by-name/at/attic-client/update.sh +++ /dev/null @@ -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 From 9f794e477d8ee7f075739f5a778aee73cbcfb6f8 Mon Sep 17 00:00:00 2001 From: Defelo Date: Tue, 8 Jul 2025 22:42:36 +0000 Subject: [PATCH 3/5] attic-client: 0-unstable-2025-07-01 -> 0-unstable-2025-07-08 Diff: https://github.com/zhaofengli/attic/compare/896ad88fa57ad5dbcd267c0ac51f1b71ccfcb4dd...07147da79388468ff85c2a650500d11ca0edd12e --- pkgs/by-name/at/attic-client/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/at/attic-client/package.nix b/pkgs/by-name/at/attic-client/package.nix index 21bea8ebba4c..13485f194176 100644 --- a/pkgs/by-name/at/attic-client/package.nix +++ b/pkgs/by-name/at/attic-client/package.nix @@ -20,13 +20,13 @@ in rustPlatform.buildRustPackage { pname = "attic"; - version = "0-unstable-2025-07-01"; + version = "0-unstable-2025-07-08"; src = fetchFromGitHub { owner = "zhaofengli"; repo = "attic"; - rev = "896ad88fa57ad5dbcd267c0ac51f1b71ccfcb4dd"; - hash = "sha256-V0EPQNsQko1a8OqIWc2lLviLnMpR1m08Ej00z5RVTfs="; + rev = "07147da79388468ff85c2a650500d11ca0edd12e"; + hash = "sha256-pHsHcWQWGyzDh48YHnSw9YVKEnQ95QWnmHNFtvo7iu0="; }; nativeBuildInputs = [ @@ -37,7 +37,7 @@ rustPlatform.buildRustPackage { buildInputs = lib.optional needNixInclude nixVersions.nix_2_24 ++ [ boost ]; cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates; - cargoHash = "sha256-AbpWnYfBMrR6oOfy2LkQvIPYsClCWE89bJav+iHTtLM="; + cargoHash = "sha256-I5GS32dOCECYKSNMi2Xs2rBRxPLcvLEWHlIIWP/bMBU="; useFetchCargoVendor = true; env = From 5754db1e88c3af115ecf0cff9500d97760e6651a Mon Sep 17 00:00:00 2001 From: Defelo Date: Tue, 8 Jul 2025 15:51:59 +0200 Subject: [PATCH 4/5] attic-client: use nix 2.28 --- pkgs/by-name/at/attic-client/package.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/at/attic-client/package.nix b/pkgs/by-name/at/attic-client/package.nix index 13485f194176..98904f414bed 100644 --- a/pkgs/by-name/at/attic-client/package.nix +++ b/pkgs/by-name/at/attic-client/package.nix @@ -16,6 +16,7 @@ let # Only the attic-client crate builds against the Nix C++ libs # This derivation is also used to build the server needNixInclude = lib.elem "attic-client" crates; + nix = nixVersions.nix_2_28; in rustPlatform.buildRustPackage { @@ -34,19 +35,15 @@ rustPlatform.buildRustPackage { installShellFiles ]; - buildInputs = lib.optional needNixInclude nixVersions.nix_2_24 ++ [ boost ]; + buildInputs = lib.optional needNixInclude nix ++ [ boost ]; cargoBuildFlags = lib.concatMapStrings (c: "-p ${c} ") crates; cargoHash = "sha256-I5GS32dOCECYKSNMi2Xs2rBRxPLcvLEWHlIIWP/bMBU="; useFetchCargoVendor = true; - env = - { - ATTIC_DISTRIBUTOR = "nixpkgs"; - } - // lib.optionalAttrs needNixInclude { - NIX_INCLUDE_PATH = "${lib.getDev nixVersions.nix_2_24}/include"; - }; + env = { + ATTIC_DISTRIBUTOR = "nixpkgs"; + } // lib.optionalAttrs needNixInclude { NIX_INCLUDE_PATH = "${lib.getDev nix}/include"; }; # 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. From f9011635617177e41de5f81bafd9a117d3d18f44 Mon Sep 17 00:00:00 2001 From: Defelo Date: Tue, 8 Jul 2025 15:44:33 +0200 Subject: [PATCH 5/5] attic-client: add defelo as maintainer --- pkgs/by-name/at/attic-client/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/at/attic-client/package.nix b/pkgs/by-name/at/attic-client/package.nix index 98904f414bed..261e63193d29 100644 --- a/pkgs/by-name/at/attic-client/package.nix +++ b/pkgs/by-name/at/attic-client/package.nix @@ -71,6 +71,7 @@ rustPlatform.buildRustPackage { maintainers = with lib.maintainers; [ zhaofengli aciceri + defelo ]; platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "attic";