Hello Benoit-Pierre,
I have tried to understand what your are describing.
I have installed google-chome (you may consider using chromium
instead)
$ nix-env -iA nixos.google-chrome
$ which google-chrome-stable
/home/layus/.nix-profile/bin/google-chrome-stable
$ readlinks google-chrome-stable # readlinks is a custom
script of mine.
/home/layus/.nix-profile/bin/google-chrome-stable
/nix/var/nix/profiles/per-user/layus/profile/bin/google-chrome-stable
/nix/var/nix/profiles/per-user/layus/profile-794-link/bin/google-chrome-stable
/nix/store/4b2v7psr4p6fm7vpq0qxv794nydd19vg-user-environment/bin/google-chrome-stable
/nix/store/xb3lsc0s2sqa3pavxbar7bbbx3hzz88b-google-chrome-61.0.3163.79/bin/google-chrome-stable
$ ls -lha ~/.local/share/applications/*.desktop
-rw------- 1 layus users 394 24 oct 21:35
/home/layus/.local/share/applications/chrome-aohghmighlieiainnegkcijnfilokake-Default.desktop
-rw------- 1 layus users 403 24 oct 21:35
/home/layus/.local/share/applications/chrome-apdfllckaahabafndbhieahigkjlhalf-Default.desktop
-rw------- 1 layus users 397 24 oct 21:35
/home/layus/.local/share/applications/chrome-blpcfgokakmgnkcojhhkbfbldkacnbeo-Default.desktop
-rw------- 1 layus users 395 24 oct 21:35
/home/layus/.local/share/applications/chrome-pjkljhegncpnkpknbcohdijeoejaedia-Default.desktop
-rw-r--r-- 1 layus users 246 24 avr 2017
/home/layus/.local/share/applications/userapp-Earlybird-62UQYY.desktop
-rw-r--r-- 1 layus users 179 1 aoû 00:07
/home/layus/.local/share/applications/userapp-transmission-gtk-N1BT3Y.desktop
-rw-r--r-- 1 layus users 205 5 oct 22:46
/home/layus/.local/share/applications/wine-extension-hlp.desktop
I have exctly the same "Extension" names as you. They look
deterministic to me, like a hash of the "Extension" itself maybe ?
$ cat
/home/layus/.local/share/applications/chrome-aohghmighlieiainnegkcijnfilokake-Default.desktop
Name=Docs
Exec=/nix/store/xb3lsc0s2sqa3pavxbar7bbbx3hzz88b-google-chrome-61.0.3163.79/share/google/chrome/google-chrome
--profile-directory=Default
--app-id=aohghmighlieiainnegkcijnfilokake
Icon=chrome-aohghmighlieiainnegkcijnfilokake-Default
NoDisplay=true
StartupWMClass=crx_aohghmighlieiainnegkcijnfilokake
So, there is something about "aohghmighlieiainnegkcijnfilokake"
here, let's look:
$ find $HOME -name
"*aohghmighlieiainnegkcijnfilokake*"
./.config/google-chrome/Default/Extensions/aohghmighlieiainnegkcijnfilokake
./.gnome/apps/chrome-aohghmighlieiainnegkcijnfilokake-Default.desktop
./.local/share/icons/hicolor/16x16/apps/chrome-aohghmighlieiainnegkcijnfilokake-Default.png
./.local/share/icons/hicolor/128x128/apps/chrome-aohghmighlieiainnegkcijnfilokake-Default.png
./.local/share/applications/chrome-aohghmighlieiainnegkcijnfilokake-Default.desktop
Here is your icon, and all the related stuff.
So, let's be clear
1) Nix / NixOS has nothing to do with these .desktop stuff (they
are not links to the store, and nix does not do that kind of messy
stuff -- well, most of the time it does not). These are created
and managed by google-chrome itself.
2) The .desktop files should be stable enough. I see no reason for
google-chrome to rename its "Extensions" all the time. Plus, we
have different chrome versions, and the exact same hashes for the
"Extension"s
3) The nix store path appears in the .desktop, and should be
removed if you want it to work across package updates.
I would recommend to rename these .desktops to something
meaningful, like google-chrome-GMail.desktop, and strip the
absolute path in front of google-chrome in Exec sections.
(i.e. `Exec=google-chrome --profile-directory=Default
--app-id=pjkljhegncpnkpknbcohdijeoejaedia`, the $PATH is used in
that case)
If google-chrome appears to rename/rehash its extensions, you will
have to find another workaround. I however believe that it is not
the case.
Regards,
-- Layus.