Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brave: fix overriding and update 1.64.116 -> 1.64.122 #303570

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

spitulax
Copy link
Contributor

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@wegank
Copy link
Member

wegank commented Apr 12, 2024

I'm not a fan of duplicating arguments like commandLineArgs ? "". Instead, how about this, which is a three-line change:

# Expression generated by update.sh; do not edit it by hand!
{ stdenv, callPackage, ... }@args:

if stdenv.isAarch64 then
  callPackage ./make-brave.nix (removeAttrs args [ "callPackage" ]) {
    pname = "brave";
    version = "1.64.116";
    url = "https://github.com/brave/brave-browser/releases/download/v1.64.116/brave-browser_1.64.116_arm64.deb";
    hash = "sha256-XC3GnutiTYdCOJPegj8MRYC5dRrBoKBg4k50ZFrlj4E=";
    platform = "aarch64-linux";
  }
else if stdenv.isx86_64 then
  callPackage ./make-brave.nix (removeAttrs args [ "callPackage" ]) {
    pname = "brave";
    version = "1.64.116";
    url = "https://github.com/brave/brave-browser/releases/download/v1.64.116/brave-browser_1.64.116_amd64.deb";
    hash = "sha256-mnvFPfZu44TZGdUb+AxaJbecQrXkIzJkYvB4GO55uv0=";
    platform = "x86_64-linux";
  }
else
  throw "Unsupported platform."

@spitulax
Copy link
Contributor Author

I'm not a fan of duplicating arguments like commandLineArgs ? "". Instead, how about this, which is a three-line change:

# Expression generated by update.sh; do not edit it by hand!
{ stdenv, callPackage, ... }@args:

if stdenv.isAarch64 then
  callPackage ./make-brave.nix (removeAttrs args [ "callPackage" ]) {
    pname = "brave";
    version = "1.64.116";
    url = "https://github.com/brave/brave-browser/releases/download/v1.64.116/brave-browser_1.64.116_arm64.deb";
    hash = "sha256-XC3GnutiTYdCOJPegj8MRYC5dRrBoKBg4k50ZFrlj4E=";
    platform = "aarch64-linux";
  }
else if stdenv.isx86_64 then
  callPackage ./make-brave.nix (removeAttrs args [ "callPackage" ]) {
    pname = "brave";
    version = "1.64.116";
    url = "https://github.com/brave/brave-browser/releases/download/v1.64.116/brave-browser_1.64.116_amd64.deb";
    hash = "sha256-mnvFPfZu44TZGdUb+AxaJbecQrXkIzJkYvB4GO55uv0=";
    platform = "x86_64-linux";
  }
else
  throw "Unsupported platform."

That was my first solution too. I've taken a look at chromium package source and it puts each arguments in default.nix, so I went with that. I suppose this is a better solution and I'm going to change it.

@wegank wegank merged commit ed5cb90 into NixOS:master Apr 12, 2024
24 checks passed
@ribru17
Copy link
Contributor

ribru17 commented Apr 14, 2024

Hello, sorry to butt in, but how should something like commandLineArgs be applied after this change? Before I had:

  brave = (pkgs.brave.override {
    commandLineArgs = [ "--force-device-scale-factor=1.5" ];
  });

but now this fails to build. Sorry for the noobie question!

EDIT: Something like the following will build, but not apply the actual options:

  brave = (pkgs.brave.overrideAttrs (oldAttrs: {
    commandLineArgs = [ "--force-device-scale-factor=1.5" ];
  }));

@spitulax
Copy link
Contributor Author

Hello, sorry to butt in, but how should something like commandLineArgs be applied after this change? Before I had:

  brave = (pkgs.brave.override {
    commandLineArgs = [ "--force-device-scale-factor=1.5" ];
  });

but now this fails to build. Sorry for the noobie question!

EDIT: Something like the following will build, but not apply the actual options:

  brave = (pkgs.brave.overrideAttrs (oldAttrs: {
    commandLineArgs = [ "--force-device-scale-factor=1.5" ];
  }));

That is the problem this PR should fix, but this PR has not been merged to nixpkgs-unstable and nixos-unstable as seen in https://nixpk.gs/pr-tracker.html?pr=303570. If you're using those branches you might want to override brave with the package from the master branch until this gets merged to the other branches.

@ribru17
Copy link
Contributor

ribru17 commented Apr 14, 2024

Ah, ok that makes sense. Thank you so much!!

@spitulax spitulax deleted the brave-fix branch April 16, 2024 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants