How to get this pending updates notification in Gnome?

You can get it like this:

$ sudo -i
$ nix-channel --update
$ nixos-rebuild build
# building...
$ ls -l result
lrwxrwxrwx 1 root root 90 11-30 22:58 result -> /nix/store/zcb2k726r6b81ip4jzd0p3prhxiasqqv-nixos-system-msi-laptop-21.05.4394.2553aee74fe
$ nix store diff-closures /run/current-system ./result
elfutils: 0.185 → 0.186, +45.7 KiB
ell: 0.44 → 0.45
epoxy: -1785.7 KiB
gawk: ∅ → 5.1.1, +190.6 KiB
harfbuzz: 2.8.2 → 3.0.0, +46.8 KiB
libdrm: 2.4.107 → 2.4.108, +21.8 KiB
libepoxy: ∅ → 1.5.4, +1785.7 KiB
libpsl: ∅ → 0.21.1
nss: ∅ → 3.72
publicsuffix-list: ∅ → 2021-09-03, +235.6 KiB
spidermonkey: ∅ → 78.15.0
tracker: 3.2.0 → 3.2.1, +29.1 KiB
util-linux: ∅ → 2.37.2, +143.4 KiB
$ nixos-rebuild switch
building Nix...
building the system configuration...
stopping the following units: accounts-daemon.service
NOT restarting the following changed units: systemd-fsck@dev-disk-by\x2dlabel-debian.service, systemd-fsck@dev-disk-by\x2duuid-DCF7\x2d772A.service
activating the configuration...
elfutils: 0.185 → 0.186, +45.7 KiB
ell: 0.44 → 0.45
epoxy: -1785.7 KiB
gawk: ∅ → 5.1.1, +190.6 KiB
harfbuzz: 2.8.2 → 3.0.0, +46.8 KiB
libdrm: 2.4.107 → 2.4.108, +21.8 KiB
libepoxy: ∅ → 1.5.4, +1785.7 KiB
libpsl: ∅ → 0.21.1
nss: ∅ → 3.72
publicsuffix-list: ∅ → 2021-09-03, +235.6 KiB
spidermonkey: ∅ → 78.15.0
tracker: 3.2.0 → 3.2.1, +29.1 KiB
util-linux: ∅ → 2.37.2, +143.4 KiB
setting up /etc...
reloading user units for roman...
setting up tmpfiles
reloading the following units: dbus.service
restarting the following units: polkit.service
starting the following units: accounts-daemon.service

But I don’t know how it is done in this twitter example. Is it like some service constantly updating channel and building?

I have this for post-build in my configuration.nix:

{
  system.activationScripts.diff = ''
    ${pkgs.nixUnstable}/bin/nix store \
        --experimental-features 'nix-command' \
        diff-closures /run/current-system "$systemConfig"
  '';
}
3 Likes