Why is chromium-source-35.0.1916.114-main lingering in my /nix/store?

Despite my mention of a specific derivation, my question is possibly more general. In this specific case, I’m looking for ways to free up disk space on my root partition, and one candidate is chromium-source-35.0.1916.114-main, which takes up ~500M on disk, and which I’m almost certain I’m not using (nix-env -q shows that chromium-codecs-ffmpeg is the only chromium-based package installed on my system, which I believe is used by Vivaldi).

I thought I would hunt down the ultimate cause of this huge derivation sitting around in my store, using nix-store -q --referrers on /nix/store/...chromium-source-35... and then successively on the results thereof. Here’s the tree of results I got:

/nix/store/k88czl6ll2flpbfmrc346qf9w1rj6k73-chromium-35.0.1916.114
  /nix/store/slj6rnhp8gkgmm2sp68hngzv8ddy2dr9-chromium-stable-35.0.1916.114
    /nix/store/1gk4c9d30kzpkc53qhppm1sm5b6q6vna-chromium-stable-with-plugins-35.0.1916.114
        /nix/store/csbrmah12j1lbmmkyls57q7kl8hc9dlj-system-path
    /nix/store/csbrmah12j1lbmmkyls57q7kl8hc9dlj-system-path

(Note that both chromium-stable-with-plugins and chromium-stable refer to system-path. The system-path derivation refers to a few other system-level things which all eventually terminate back at the same system-path derivation.)

I should mention that my system is already garbage collected.

I’m at a loss to understand why the original derivation is still in my system–I don’t have any chromium browser packages installed, and my configuration.nix file doesn’t mention chromium at all. Any help in understanding what’s going on, and getting rid of these files from my store, would be immensely appreciated. Thanks in advance!

roni

Do you by any chance have an older generation referring to this package? What’s the output of:

sudo nix-env -p /nix/var/nix/profiles/system --list-generations

The output of that command is

 271   2020-04-09 18:47:37   (current)

Looks like no older generations are referring to that package?

roni

could it be a user that has an older nixpkgs channel?

Try passing the system path and chromium path to nix why-depends. You can also make sure this is indeed your current system path using readlink /var/run/current-system/sw.

1 Like

I did not know about nix why-depends, thank you! Here’s the output of running nix why-depends /nix/store/csbrmah12j1lbmmkyls57q7kl8hc9dlj-system-path /nix/store/wxpg2br35vg22097mcdf35f9pcy4pwdg-chromium-source-35.0.1916.114-main:

/nix/store/csbrmah12j1lbmmkyls57q7kl8hc9dlj-system-path
╚═══share/icons -> /nix/store/slj6rnhp8gkgmm2sp68hngzv8ddy2dr9-chromium-stable-35.0.1916.114/share/icons
    => /nix/store/slj6rnhp8gkgmm2sp68hngzv8ddy2dr9-chromium-stable-35.0.1916.114
    ╚═══bin/chromium: …hromium-sandbox.exec /nix/store/k88czl6ll2flpbfmrc346qf9w1rj6k73-chromium-35.0.1916.114/libexec/…
        => /nix/store/k88czl6ll2flpbfmrc346qf9w1rj6k73-chromium-35.0.1916.114
        ╚═══libexec/chromium/resources/extension/demo/library.js -> /nix/store/wxpg2br35vg22097mcdf35f9pcy4pwdg-chromium-source-35.0.1916.114-main/chrome/browser/resources/extension_resource/demo/library.js
            => /nix/store/wxpg2br35vg22097mcdf35f9pcy4pwdg-chromium-source-35.0.1916.114-main

It looks like chromium-stable's share/icons directory is being used by the system path? That’s definitely odd right? Where can I see these files linked into the system path?

roni

Running nix-channel --list as my regular user gives me

nixos https://nixos.org/channels/nixos-19.09
nixpkgs https://nixos.org/channels/nixpkgs-unstable

Running that command with sudo gives me:

nixos https://nixos.org/channels/nixos-19.09

Does this look right to you?

roni

Definitely odd, especially considering that Chromium version is from 2014(!). Have you checked this is your current system path? If not, does passing it to nix-store --query --roots help in finding out why it’s still alive?

1 Like

Wow, bingo!

The output of nix-store --query --roots /nix/store/wxpg2br35vg22097mcdf35f9pcy4pwdg-chromium-source-35.0.1916.114-main is:

/nix/var/nix/profiles/system-profiles/hdmi-sound-1-link -> /nix/store/xhl3li0n9rici22hi96vi5lyz7xax8wc-nixos-14.10pre44881.f7c7282                                                                        
/nix/var/nix/profiles/system-profiles/hdmi-audio-1-link -> /nix/store/xhl3li0n9rici22hi96vi5lyz7xax8wc-nixos-14.10pre44881.f7c7282

I have a vague memory of my HDMI output not working properly when I upgraded the Linux kernel (the timeframe would have been in 2015, so these system names look right), but I honestly have no idea how I did that, or why nix-collect-garbage -d doesn’t get rid of them. Any ideas?

My current system seems to be (from the output of ls -l /var/run/current-system):

lrwxrwxrwx 1 root root 87 Apr 27 16:10 /var/run/current-system -> /nix/store/20dpdp4rvqxkz0ayfii4g3hgz260wyv2-nixos-system-kahless-19.09.2229.d7843c8add6

Thanks for your help so far!

roni

1 Like

so, just remove those profile links and nix-collect-garbage -d

These system profiles are created by nixos-rebuild -p hdmi-sound-1 etc., so I suppose you did just that. You can indeed simply delete them: How to remove a NixOS system profile?

You’re right, I must have done exactly that and then forgotten all about it.

I removed those system profile links, ran garbage collection, and liberated a few GB of disk space from the store. Thanks for your help with this, everyone!

roni