From 37004cbc022b149b902a758036b4b2253a18cf26 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 25 Jul 2026 20:49:21 -0700 Subject: [PATCH] brave, brave-origin: fix overriding Previously, the `callPackage ./make-brave.nix { }` call produced a function that was immediately evaluated to produce a package. Unfortunately, because callPackage did not directly produce the package, the final package wasn't overridable (no `.override` function). This patch instead evaluates the brave/brave-origin function first to produce the "package" function, then calls callPackage on the resulting package function. --- .../networking/browsers/brave/default.nix | 2 +- .../networking/browsers/brave/make-brave.nix | 42 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pkgs/applications/networking/browsers/brave/default.nix b/pkgs/applications/networking/browsers/brave/default.nix index 88b7f01cdbad..6064c243e22f 100644 --- a/pkgs/applications/networking/browsers/brave/default.nix +++ b/pkgs/applications/networking/browsers/brave/default.nix @@ -28,7 +28,7 @@ let pkg = import release; fd = flavorData.${pkg.flavor or "browser"}; in - callPackage ./make-brave.nix { } (pkg // fd); + callPackage ((import ./make-brave.nix) (pkg // fd)) { }; in { diff --git a/pkgs/applications/networking/browsers/brave/make-brave.nix b/pkgs/applications/networking/browsers/brave/make-brave.nix index f9e452195066..1ef2be0c045c 100644 --- a/pkgs/applications/networking/browsers/brave/make-brave.nix +++ b/pkgs/applications/networking/browsers/brave/make-brave.nix @@ -1,3 +1,24 @@ +{ + pname, + version, + # Map from Nix system strings ("x86_64-linux", "aarch64-darwin", ...) to + # the corresponding upstream `{ url, hash }` record. Encoding the per-system + # sources as data rather than positional arguments lets channel-specific + # package.nix files drop platforms that upstream hasn't published yet. + archives, + # Upstream product flavor: "browser" (the regular Brave) or "origin" (the + # stripped-down Brave Origin). + flavor ? "browser", + # Flavor-specific paths supplied by the caller (default.nix). + optStem, + fileStem, + appIdStem, + darwinStem, + changelogFile, + homepage, + innerBinary, +}: + { lib, stdenv, @@ -69,27 +90,6 @@ enableVulkan ? vulkanSupport, }: -{ - pname, - version, - # Map from Nix system strings ("x86_64-linux", "aarch64-darwin", ...) to - # the corresponding upstream `{ url, hash }` record. Encoding the per-system - # sources as data rather than positional arguments lets channel-specific - # package.nix files drop platforms that upstream hasn't published yet. - archives, - # Upstream product flavor: "browser" (the regular Brave) or "origin" (the - # stripped-down Brave Origin). - flavor ? "browser", - # Flavor-specific paths supplied by the caller (default.nix). - optStem, - fileStem, - appIdStem, - darwinStem, - changelogFile, - homepage, - innerBinary, -}: - let inherit (lib) optional