nixpkgs/pkgs/applications/networking/browsers/chromium
Sofi 1ddba4aadb
chromium: fix web app linking
Currently Chromium will generate its Web App shortcuts by pointing to
the current unwrapped executable of itself. This leads to all Web App
shortcuts failing to launch as it is not launched trough nixpkgs's
wrapper.

This fix will set the `CHROME_WRAPPER` environment variable to point
to a valid wrapper script, allowing chromium based browsers to generate
valid `.desktop` files.

NOTE: As these files are only set once by the browser inside of
`~/.local/share/applications` and not updated, this fix will only work
for generating new shortcuts, and only work as long as the relevant
binary is available in `$PATH` for that user.

INFO: While generic sounding, `CHROME_WRAPPER` is only invoked inside of
`web_app_shortcut_linux.cc`[^1], so it should only affect the generation
of web app shortcut files.

INFO: There is a similar patch for google-chrome itself in nixpkgs.[^2]

[^1]: https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/shell_integration_linux.cc;l=405;drc=b8f43a4e55639b03f76eccc6f6b951f2d06b8833
[^2]: https://github.com/NixOS/nixpkgs/pull/155430/
2022-12-16 14:37:45 +01:00
..
patches chromium: Fix the build 2022-09-02 23:34:18 +02:00
browser.nix ungoogled-chromium: added myself as maintainer 2022-04-01 22:41:06 +02:00
common.nix ungoogled-chromium: 107.0.5304.122 -> 108.0.5359.72 2022-12-02 15:48:34 +01:00
default.nix chromium: fix web app linking 2022-12-16 14:37:45 +01:00
get-commit-message.py chromium: get-commit-message.py: Support releases with 1 security fix 2022-04-10 22:38:54 +02:00
README.md
ungoogled-flags.toml ungoogled-chromium: 103.0.5060.134 -> 104.0.5112.81 2022-08-05 09:16:59 +02:00
ungoogled.nix
update.py chromedriver: fix darwin aarch64 2022-10-08 16:15:57 +03:00
upstream-info.json Merge pull request #206305 from primeos/chromiumDev 2022-12-15 23:39:32 +01:00

Maintainers

  • Note: We could always use more contributors, testers, etc. E.g.:
    • A dedicated maintainer for the NixOS stable channel
    • PRs with cleanups, improvements, fixes, etc. (but please try to make reviews as easy as possible)
    • People who handle stale issues/PRs
  • Primary maintainer (responsible for all updates): @primeos
  • Testers (test all stable channel updates)
    • nixos-unstable:
      • x86_64: @danielfullmer
      • aarch64: @thefloweringash
    • Stable channel:
      • x86_64: @Frostman
  • Other relevant packages:
    • chromiumBeta and chromiumDev: For testing purposes only (not build on Hydra). We use these channels for testing and to fix build errors in advance so that chromium updates are trivial and can be merged fast.
    • google-chrome, google-chrome-beta, google-chrome-dev: Updated via Chromium's upstream-info.json
    • ungoogled-chromium: @squalus
    • chromedriver: Updated via Chromium's upstream-info.json and not built from source.

Upstream links

Updating Chromium

Simply run ./pkgs/applications/networking/browsers/chromium/update.py to update upstream-info.json. After updates it is important to test at least nixosTests.chromium (or basic manual testing) and google-chrome (which reuses upstream-info.json).

Note: The source tarball is often only available a few hours after the release was announced. The CI/CD status can be tracked here:

To run all automated NixOS VM tests for Chromium, ungoogled-chromium, and Google Chrome (not recommended, currently 6x tests!):

nix-build nixos/tests/chromium.nix

A single test can be selected, e.g. to test ungoogled-chromium (see channelMap in nixos/tests/chromium.nix for all available options):

nix-build nixos/tests/chromium.nix -A ungoogled

(Note: Testing Google Chrome requires export NIXPKGS_ALLOW_UNFREE=1.)

For custom builds it's possible to "override" channelMap.

Backports

All updates are considered security critical and should be ported to the stable channel ASAP. When there is a new stable release the old one should receive security updates for roughly one month. After that it is important to mark Chromium as insecure (see 69e4ae56c4 for an example; it is important that the tested job still succeeds and that all browsers that use upstream-info.json are marked as insecure).

Major version updates

Unfortunately, Chromium regularly breaks on major updates and might need various patches. Either due to issues with the Nix build sandbox (e.g. we cannot fetch dependencies via the network and do not use standard FHS paths) or due to missing upstream fixes that need to be backported.

Good sources for such patches and other hints:

If the build fails immediately due to unknown compiler flags this usually means that a new major release of LLVM is required.

Beta and Dev channels

Those channels are only used to test and fix builds in advance. They may be broken at times and must not delay stable channel updates.

Testing

Useful tests: