Mermaid-cli triggers chromium compilation

Hi there,

I’ve been having an ongoing issue with the mermaid-cli package (which depends on chromium), whereby an update from mermaid-cli seems to trigger a full compilation of chromium.

Does anyone know how I can ensure that a cached version of chromium is always used, so that the compilation isn’t triggered as it’s an exceptionally lengthy and inconvenient compilation process.

Thanks!
JH

these 5 paths will be fetched (133.11 MiB download, 680.50 MiB unpacked):
  /nix/store/y0lb1gnwsfdbdgxfhdric8gc9lac47m9-chromium-132.0.6834.110
  /nix/store/nmnc9798pr68pbby1f3yi20fd2vsv0ss-chromium-132.0.6834.110-sandbox
  /nix/store/07g2hwzdr80gysp05mw1x03xx9jjxriw-chromium-unwrapped-132.0.6834.110
  /nix/store/5jazqif77pvqa0jffcvf668cz212jhlj-chromium-unwrapped-132.0.6834.110-sandbox
  /nix/store/3by4lkl1pqsak1z092vlnrn77v2dciqq-mermaid-cli-10.9.0
copying path '/nix/store/07g2hwzdr80gysp05mw1x03xx9jjxriw-chromium-unwrapped-132.0.6834.110' from 'https://cache.nixos.org'...
copying path '/nix/store/5jazqif77pvqa0jffcvf668cz212jhlj-chromium-unwrapped-132.0.6834.110-sandbox' from 'https://cache.nixos.org'...
copying path '/nix/store/nmnc9798pr68pbby1f3yi20fd2vsv0ss-chromium-132.0.6834.110-sandbox' from 'https://cache.nixos.org'...
copying path '/nix/store/y0lb1gnwsfdbdgxfhdric8gc9lac47m9-chromium-132.0.6834.110' from 'https://cache.nixos.org'...
copying path '/nix/store/3by4lkl1pqsak1z092vlnrn77v2dciqq-mermaid-cli-10.9.0' from 'https://cache.nixos.org'...
/nix/store/3by4lkl1pqsak1z092vlnrn77v2dciqq-mermaid-cli-10.9.0

mermaid-cli and chromium appear to hit the cache for me, perhaps you have some overlay in your config preventing a cache hit.

It doesn’t seem to be an overlay problem in my case:

$ nixos-rebuild --flake . repl
nix-repl> pkgs.overlays
[
  «lambda @ /nix/store/0lgg4b7bvl8gjc04gznrhmk6qq6yy1yf-source/overlays/mpv.nix:1:2»
  «lambda overlay @ /nix/store/8fz452b6ss0l67kzixr5mkj6687r95lp-source/flake.nix:9:19»
  «lambda @ /nix/store/ilk7kqq74yj6nmbyc9bdxpp06y6865gj-source/default.nix:1:1»
  «lambda @ /nix/store/s6agnzjr3kg5sayjy0b0ms52bkvifqrv-source/modules/overlays.nix:19:38»
]

None of the files listed below or any of their descendants make any reference to chromium that I could find.

Additionally, if I try to install pkgs-stable.chromium directly, it triggers a build as well.

nix-repl> config.nix.settings.trusted-substituters
[
  "https://nix-community.cachix.org"
  "https://cache.garnix.io"
  "https://numtide.cachix.org"
  "https://cache.nixos.org"
  "https://cache.lix.systems"
  "https://nix-community.cachix.org"
  "https://hyprland.cachix.org"
]

nix-repl> config.nix.settings.trusted-public-keys
[
  "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
  "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
  "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
  "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
  "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="
  "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
  "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
]

nix-repl> pkgs-stable.chromium 
«derivation /nix/store/4b3kgcp2iskijszmvlbq5qwb7scjkmnf-chromium-132.0.6834.159.drv»

This issue doesn’t seem to happen with ungoogled-chromium (which should probably be the default for dependencies like mermaid-cli imho).

So I ended up doing:

    (pkgs-stable.mermaid-cli.override { # Pwetty Diagwams
      chromium = pkgs-stable.ungoogled-chromium;
    })

Which is now respecting the cache.

Are you on x86_64-linux?

The whole point of an overlay is that all reverse dependencies are rebuilt. You don’t need to mention chromium, just one of its transitive deps, for it to get rebuilt.

If it’s happening across all nixpkgs instances, I’d guess there’s some other config issue.

1 Like

Are you on x86_64-linux?

Yep.

The whole point of an overlay is that all reverse dependencies are rebuilt. You don’t need to mention chromium, just one of its transitive deps, for it to get rebuilt.

Thanks for this explanation, I didn’t realise this. I’m still quite new to overlays having only made my first one yesterday!

If it’s happening across all nixpkgs instances, I’d guess there’s some other config issue.

Yep! I realised that I was using nixos-unstable-small, not nixos-unstable, and that resolved it.