Skip to content

brave, brave-origin: extract shared builder, init at 1.92.144 - #540488

Merged
SuperSandro2000 merged 1 commit into
NixOS:masterfrom
rachalaraj:brave-and-brave-origin
Jul 25, 2026
Merged

SuperSandro2000 merged 1 commit into
NixOS:masterfrom
rachalaraj:brave-and-brave-origin

Conversation

@rachalaraj

@rachalaraj rachalaraj commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

This PR introduces the brave-origin variant and extracts a shared builder for Brave.

  • brave: new, 1.92.144
  • brave-origin: new, 1.92.144

Brave Origin is a stripped-down build of the browser that drops the non-privacy extras (rewards, wallet, AI, etc.) while keeping Shields and the Chromium-based engine.

This is a continuation of #513143. To address @buckley310's concerns about the maintenance burden of nightly and beta versions, this new PR is strictly scoped to stable channels only. Since the brave-origin stable releases are tied directly to the standard brave stable releases, the maintenance overhead is effectively zero. As @buckley310 suggested, experimental beta/nightly channels are better suited for a separate flake or repository.

All references to beta and nightly channels have been removed from the package and the update script.

The shared builder lives outside pkgs/by-name/ because by-name forbids cross-directory file references, which rules out sharing one make-brave.nix across multiple by-name packages. Layout follows the firefox{,-esr-*} pattern.

cc
cc package maintainers: @uskudnik, @JeffLabonte, @nasirhm, @buckley310
cc @Dreaming-Codes (author of #513143).

Things done

  • Built on platform:
    • x86_64-linux (both packages — nix-build -A brave -A brave-origin)
    • aarch64-linux
    • aarch64-darwin
  • Verified each commit evaluates cleanly in isolation (each expected attribute builds at every intermediate commit).
  • brave store path is unchanged between master and the refactor commit.
  • Tested basic functionality of all binary files: each ./result/bin/brave{,-origin} --version reports the correct channel name.
  • Ran the maintainer check: nix-build lib/tests/maintainers.nix.
  • Ran nixfmt on every touched .nix file.
  • Ran nixpkgs-review on this PR.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.
  • Follows the automation/AI policy.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 12.first-time contribution This PR is the author's first one; please be gentle! 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Jul 10, 2026
@buckley310

Copy link
Copy Markdown
Contributor

Looks pretty good. If you can update the PR to match the brave update that just got merged, and flag update.sh as executable, I'll approve it.

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 11, 2026
@rachalaraj
rachalaraj force-pushed the brave-and-brave-origin branch from d92c524 to 7072634 Compare July 12, 2026 05:10
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 12, 2026
@rachalaraj

Copy link
Copy Markdown
Member Author

Looks pretty good. If you can update the PR to match the brave update that just got merged, and flag update.sh as executable, I'll approve it.

Done

@buckley310

Copy link
Copy Markdown
Contributor

Sorry, I missed one thing when I was reading it yesterday.
They try to keep all-packages.nix somewhat organized. The Brave entries should be in the ### APPLICATIONS section which is in alphabetical-ish order, rather than the end of the file. (Currently it would go nearby line ~8482)

Other than that, I tested the browser build for x86_64-linux on nixos-unstable, tested the update script, and read through the new files for any obvious issues. Did not find any other issues.

@rachalaraj
rachalaraj force-pushed the brave-and-brave-origin branch from 7072634 to af46995 Compare July 13, 2026 01:47
@rachalaraj

Copy link
Copy Markdown
Member Author

Sorry, I missed one thing when I was reading it yesterday. They try to keep all-packages.nix somewhat organized. The Brave entries should be in the ### APPLICATIONS section which is in alphabetical-ish order, rather than the end of the file. (Currently it would go nearby line ~8482)

Other than that, I tested the browser build for x86_64-linux on nixos-unstable, tested the update script, and read through the new files for any obvious issues. Did not find any other issues.

Fixed it

@buckley310 buckley310 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested re-launching it to make sure the updated all-packages was working, Looks good.

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Jul 13, 2026
@rachalaraj

rachalaraj commented Jul 13, 2026 •

Copy link
Copy Markdown
Member Author

Do i need the remaining 2 approvals from @uskudnik and @JeffLabonte to get this PR merged?

@jys1670

jys1670 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Do i need the remaining 2 approvals from @uskudnik and @JeffLabonte to get this PR merged?

Not necessarily, as other PRs have been open for months and only buckley310 seems to care. We just need to find someone with merge permissions.

@Jappie3 Jappie3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not clear from the PR body whether or not this PR follows the automation / AI policy (https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#automationai-policy), did you remove it from the template when creating the PR?

@buckley310

Copy link
Copy Markdown
Contributor

I was going to give it a couple days in case anyone else tagged on this wanted to weigh in. After that, I was going to ping someone in this thread or post on Discourse to get it merged. Could potentially get merged in the meantime anyway if a committer sees it, that also works.

I think the AI/Automation checkbox is missing because this PR was partially from another one which predates that checkbox.

@rachalaraj
rachalaraj force-pushed the brave-and-brave-origin branch from af46995 to a4b6d22 Compare July 15, 2026 11:19
@buckley310

Copy link
Copy Markdown
Contributor

New change just drops x86 darwin. Probably an OK time to do that, since its deprecated in 26.11.

@buckley310

buckley310 commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Just realized that x86 darwin got treewide-dropped in master already, so good we updated that :)

New brave security update is out, so this PR will need to sync up with that after that one merges.

It's been a few days so I don't think anyone who was pinged has anything else to say, so after the security update settles I'll get moving on this.

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 16, 2026
@rachalaraj
rachalaraj force-pushed the brave-and-brave-origin branch 2 times, most recently from 0c4e0a3 to 8c935f1 Compare July 16, 2026 05:33
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 16, 2026
--replace-fail 'CHROME_WRAPPER' 'WRAPPER'

ln -sf $BINARYWRAPPER $out/bin/brave
ln -sf $BINARYWRAPPER $out/bin/${pname}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not use optName here, too?

@rachalaraj rachalaraj Jul 23, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using ${pname} which resolves to the same value.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a tracking issue to not use pname in string interpolation 😅

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just send a PR afterward, otherwise we have here merge conflicts everyday

@rachalaraj
rachalaraj force-pushed the brave-and-brave-origin branch 2 times, most recently from df40ef9 to d5b8ca4 Compare July 23, 2026 15:56
@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 23, 2026
@rachalaraj
rachalaraj force-pushed the brave-and-brave-origin branch from 37bd4e3 to fd906bb Compare July 23, 2026 16:32
@buckley310

Copy link
Copy Markdown
Contributor

Code, as of fd906bb looks okay to me.
No significant functionality changes since the last time I looked at it, just re-organizes some things.

I think you'll need to squash the commits, though.

@rachalaraj
rachalaraj force-pushed the brave-and-brave-origin branch from fd906bb to 73f2a33 Compare July 24, 2026 06:05
@rachalaraj

Copy link
Copy Markdown
Member Author

I wish there's a 'Nixpkgs Merge Requests' matrix room similar to 'Nixpkgs Review Requests'
It's very hard to get committers attention on PRs unlike reviewers
Seems like there aren't many committers or maybe something else

@buckley310 buckley310 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New commit looks good. Just cleanup, no code changes.
Tested launching the browsers anyway, just to make sure.

Introduce brave-origin variant and extract a shared builder for Brave.

- brave: 1.92.144
- brave-origin: new, 1.92.144

Brave Origin is a stripped-down build that drops non-privacy extras
(rewards, wallet, AI, etc.) while keeping Shields and the Chromium engine.

The shared builder lives outside pkgs/by-name/ because by-name forbids
cross-directory file references. Layout follows the firefox pattern.

Co-authored-by: buckley310 <[email protected]>
@rachalaraj
rachalaraj force-pushed the brave-and-brave-origin branch from 73f2a33 to a16f93f Compare July 25, 2026 02:13
@rachalaraj rachalaraj changed the title brave, brave-origin: extract shared builder, init at 1.92.143 brave, brave-origin: extract shared builder, init at 1.92.144 Jul 25, 2026
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 25, 2026
@rachalaraj
rachalaraj requested a review from buckley310 July 25, 2026 02:18
@rachalaraj

Copy link
Copy Markdown
Member Author

Version bumped

@rachalaraj rachalaraj mentioned this pull request Jul 25, 2026
4 of 13 tasks
@SuperSandro2000
SuperSandro2000 added this pull request to the merge queue Jul 25, 2026
Merged via the queue into NixOS:master with commit 166a63e Jul 25, 2026
23 checks passed
@marcelmanz

Copy link
Copy Markdown

I created a separate flake repo for the nightly + beta channels in case anyone is interested: https://codeberg.org/marcelmanz/brave-origin-channels

@zspher zspher mentioned this pull request Jul 30, 2026
4 tasks done
@rachalaraj
rachalaraj deleted the brave-and-brave-origin branch August 31, 2026 03:33
Bad3r added a commit to Bad3r/nixos that referenced this pull request Sep 21, 2026
NixOS/nixpkgs#540488 merged 166a63ea12788b94493842c4574e5d3fd4496c92 on
2026-07-25, an ancestor of the nixpkgs revision this flake pins
(1f6cbe8047dc154462ceec5b0c37b99cbeacc1cf). It ships pkgs.brave-origin
through a shared brave/brave-origin builder, superseding the closed
NixOS/nixpkgs#511131 this repo's copy in packages/brave-origin/ was
written against.

Remove packages/brave-origin/ and modules/custom-overlays/brave-origin.nix.
modules/browsers/brave-origin/apps.nix already selects the package with
lib.mkPackageOption pkgs "brave-origin" { }, so it now resolves straight
to the nixpkgs attribute with no config change; only its header comment
drops the stale local-copy notes. docs/ONBOARDING.md still lists
brave-origin as an update.py example; left alone since that page is
already over the docs-style 150-line cap and out of scope here.

Validation:
nix run path:.#treefmt -- modules/browsers/brave-origin/apps.nix
nix eval path:.#nixosConfigurations.songbird.pkgs.brave-origin.version -> 1.95.101
nix eval path:.#nixosConfigurations.tpnix.pkgs.brave-origin.version -> 1.95.101
nix build path:.#nixosConfigurations.songbird.pkgs.brave-origin (substituted from cache.nixos.org)
nix eval --raw path:.#nixosConfigurations.songbird.config.system.build.toplevel.drvPath
nix eval --raw path:.#nixosConfigurations.tpnix.config.system.build.toplevel.drvPath
@herbetom herbetom mentioned this pull request Nov 8, 2026
3 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants