From b9e3822cf143cc4a34af3d7d4b2f102027695dfe Mon Sep 17 00:00:00 2001 From: unixpariah <100892812+unixpariah@users.noreply.github.com> Date: Tue, 12 Aug 2025 21:51:51 +0200 Subject: [PATCH 1/2] sccache: add distributed features (dist-client, dist-server) --- pkgs/by-name/sc/sccache/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/sc/sccache/package.nix b/pkgs/by-name/sc/sccache/package.nix index a84126411ace..5bec7dd7043b 100644 --- a/pkgs/by-name/sc/sccache/package.nix +++ b/pkgs/by-name/sc/sccache/package.nix @@ -4,6 +4,7 @@ rustPlatform, pkg-config, openssl, + distributed ? false, }: rustPlatform.buildRustPackage rec { @@ -19,6 +20,11 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-1kfKBN4uRbU5LjbC0cLgMqoGnOSEAdC0S7EzXlfaDPo="; + buildFeatures = lib.optionals distributed [ + "dist-client" + "dist-server" + ]; + nativeBuildInputs = [ pkg-config ]; From 22b7bcb53726456d13f92c42f8343cc902467d61 Mon Sep 17 00:00:00 2001 From: unixpariah <100892812+unixpariah@users.noreply.github.com> Date: Tue, 12 Aug 2025 21:54:30 +0200 Subject: [PATCH 2/2] sccache: use `finalAttrs` pattern instead of `rec` --- pkgs/by-name/sc/sccache/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/sc/sccache/package.nix b/pkgs/by-name/sc/sccache/package.nix index 5bec7dd7043b..59ee81490845 100644 --- a/pkgs/by-name/sc/sccache/package.nix +++ b/pkgs/by-name/sc/sccache/package.nix @@ -7,14 +7,14 @@ distributed ? false, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { version = "0.10.0"; pname = "sccache"; src = fetchFromGitHub { owner = "mozilla"; repo = "sccache"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-VEDMeRFQKNPS3V6/DhMWxHR7YWsCzAXTzp0lO+COl08="; }; @@ -40,11 +40,11 @@ rustPlatform.buildRustPackage rec { description = "Ccache with Cloud Storage"; mainProgram = "sccache"; homepage = "https://github.com/mozilla/sccache"; - changelog = "https://github.com/mozilla/sccache/releases/tag/v${version}"; + changelog = "https://github.com/mozilla/sccache/releases/tag/v${finalAttrs.version}"; maintainers = with lib.maintainers; [ doronbehar figsoda ]; license = lib.licenses.asl20; }; -} +})