Why does the following setup reset firefox?

I have a firefox.nix file, which is imported in systemPackages using (callPackage ./firefox.nix { gconf = gnome2.GConf; }):

I get a firefox-exe, and then I run it as another user (I create a firefox user, with a home directory in /home/firefox and run it as sudo -i -u firefox firefox-exe).

For some reason, whenever I update firefox (I change the version and run nixos-rebuild switch --upgrade) and then restart firefox, firefox resets itself (looses everything, history, bookmarks, cookies), even though /home/firefox/.cache, /home/firefox/.config, and /home/firefox/.mozilla still exists.

What’s happening here? Whenever I used firefox on non-nixos systems, it didn’t do this?

Just out of curiosity, Why do you use a firefox user and all that hassle?

I’d probably check firefox: 68.0.2 -> 69.0 by andir · Pull Request #67924 · NixOS/nixpkgs · GitHub and the SNAP_NAME before that. I don’t know details.

1 Like

You want to set SNAP_NAME and those two listed in the commit. Mozilla started restricting up- & downgrade paths for profiles. They now think that you are doing funny things when the path of the executable changes (SNAM_NAME works around that). They also recently started restricting downgrades and now use some embedded build timestamps etc… to determine if you are downgrading while you might just be switching between two firefox builds of the very same verison.

1 Like