Firefox - profile not found

HI there, I am trying to setup firefox-devedition.

{ inputs, pkgs, ... }: {

  programs.firefox = {
    enable = true;
    package = pkgs.firefox-devedition;
    # enableGnomeExtensions = true;
    # languagePacks = [ "en-CA" ];
    profiles = {
      default = {
        id = 0;
        name = "Default";
        isDefault = true;
        extensions = with pkgs.nur.repos.rycee.firefox-addons; [
          # see: https://github.com/nix-community/nur-combined/blob/2691dd44ce8664be1d33f61ed808aca7de38a82f/repos/rycee/pkgs/firefox-addons/generated-firefox-addons.nix
          onepassword-password-manager
          darkreader
          ublock-origin
          privacy-badger
          sidebery

        ];
    
      };

    };
  };

  home.sessionVariables = {
    MOZ_ENABLE_WAYLAND = 1;
    MOZ_USE_XINPUT2 = "1";
  };
}

Now, for some reason, after I rebuild and open the browser, I get: Your Firefox profile cannot be loaded. It may be missing or inaccessible.

☸ default in ~/.mozilla on ☁️  (us-west-2) at 22:49:42 
λ ls 
0700 drwx------ - dustin 24 Jun 11:32  extensions
0700 drwx------ - dustin 10 Sep 22:49  firefox
0700 drwx------ - dustin 24 Jun 11:30  native-messaging-hosts

folder permissions look ok here.

λ ls firefox/default/
0777 lrwxrwxrwx    0 dustin 10 Sep 22:49  .keep -> /nix/store/g5q65hpidlqwnnzii4nm8wdsvsqcyq6c-home-manager-files/.mozilla/firefox/default/.keep
0644 .rw-r--r--    0 dustin  4 Aug 11:31  .parentlock
0644 .rw-r--r--  40k dustin  4 Aug 11:31  addons.json
0644 .rw-r--r--  10k dustin  4 Aug 11:12  addonStartup.json.lz4
0644 .rw-r--r-- 7.9k dustin  4 Aug 12:18  AlternateServices.txt
0755 drwxr-xr-x    - dustin  4 Aug 11:37  bookmarkbackups
0644 .rw-r--r--  221 dustin  4 Aug 11:32  broadcast-listeners.json
0600 .rw------- 229k dustin 31 Jul 10:47  cert9.db
0600 .rw-------  273 dustin  4 Aug 11:11  compatibility.ini
0644 .rw-r--r--  875 dustin 27 Jul 08:09  containers.json
0644 .rw-r--r-- 262k dustin  4 Aug 11:31  content-prefs.sqlite
0644 .rw-r--r-- 524k dustin  4 Aug 12:18  cookies.sqlite
0700 drwx------    - dustin  4 Aug 11:32  crashes
0755 drwxr-xr-x    - dustin 27 Jul 08:09  datareporting
0644 .rw-r--r-- 2.0k dustin  4 Aug 11:12  extension-preferences.json
0644 .rw-r--r--  717 dustin  4 Aug 11:31  extension-settings.json
0755 drwxr-xr-x    - dustin 28 Jul 14:31  extension-store
0755 drwxr-xr-x    - dustin 10 Sep 22:49  extensions
0644 .rw-r--r-- 150k dustin  4 Aug 11:12  extensions.json
0644 .rw-r--r-- 5.2M dustin  4 Aug 12:18  favicons.sqlite
0644 .rw-r--r-- 262k dustin 31 Jul 10:49  formhistory.sqlite
0755 drwxr-xr-x    - dustin 27 Jul 11:39  gmp-gmpopenh264
0755 drwxr-xr-x    - dustin 27 Jul 11:39  gmp-widevinecdm
0644 .rw-r--r--  410 dustin 27 Jul 08:09  handlers.json
0600 .rw------- 295k dustin 27 Jul 08:09  key4.db
0777 lrwxrwxrwx   17 dustin  4 Aug 11:31  lock -> 127.0.0.2:+463315
0700 drwx------    - dustin 27 Jul 08:09  minidumps
0644 .rw-r--r--  98k dustin  4 Aug 12:16  permissions.sqlite
0600 .rw-------  461 dustin 27 Jul 08:09  pkcs11.txt
0644 .rw-r--r-- 5.2M dustin  4 Aug 12:18  places.sqlite
0600 .rw-------  20k dustin  4 Aug 12:18  prefs.js
0644 .rw-r--r--  66k dustin  4 Aug 11:31  protections.sqlite
0755 drwxr-xr-x    - dustin 27 Jul 11:54  security_state
0644 .rw-r--r--  288 dustin  4 Aug 12:18  sessionCheckpoints.json
0755 drwxr-xr-x    - dustin  4 Aug 12:18  sessionstore-backups
0644 .rw-r--r-- 7.2k dustin  4 Aug 12:18  sessionstore.jsonlz4
0755 drwxr-xr-x    - dustin  4 Aug 11:12  settings
0644 .rw-r--r--   18 dustin 27 Jul 08:09  shield-preference-experiments.json
0644 .rw-r--r-- 2.5k dustin  4 Aug 11:15  SiteSecurityServiceState.txt
0755 drwxr-xr-x    - dustin 27 Jul 11:35  storage
0644 .rw-r--r--  33k dustin 27 Jul 11:35  storage-sync-v2.sqlite
0644 .rw-r--r--  33k dustin  4 Aug 12:18  storage-sync-v2.sqlite-shm
0644 .rw-r--r-- 984k dustin  4 Aug 11:31  storage-sync-v2.sqlite-wal
0644 .rw-r--r-- 9.2k dustin  4 Aug 12:18  storage.sqlite
0644 .rw-r--r--   41 dustin 27 Jul 08:09  times.json
0644 .rw-r--r--  98k dustin 27 Jul 08:09  webappsstore.sqlite
0644 .rw-r--r--  678 dustin  4 Aug 12:18  xulstore.json

permissions look ok here too.

λ ls firefox/default/extensions
0777 lrwxrwxrwx  40M dustin 10 Sep 22:49  87677a2c52b84ad3a151a4a72f5bd3c4@jetpack.xpi -> /nix/store/g5q65hpidlqwnnzii4nm8wdsvsqcyq6c-home-manager-files/.mozilla/firefox/default/extensions/87677a2c52b84ad3a151a4a72f5bd3c4@jetpack.xpi
0777 lrwxrwxrwx 669k dustin 10 Sep 22:49  addon@darkreader.org.xpi -> /nix/store/g5q65hpidlqwnnzii4nm8wdsvsqcyq6c-home-manager-files/.mozilla/firefox/default/extensions/addon@darkreader.org.xpi
0644 .rw-r--r-- 213k dustin 27 Jul 11:38  en-CA@dictionaries.addons.mozilla.org.xpi
0777 lrwxrwxrwx 2.0M dustin 10 Sep 22:49  jid1-MnnxcxisBPnSXQ@jetpack.xpi -> /nix/store/g5q65hpidlqwnnzii4nm8wdsvsqcyq6c-home-manager-files/.mozilla/firefox/default/extensions/jid1-MnnxcxisBPnSXQ@jetpack.xpi
0644 .rw-r--r-- 552k dustin 27 Jul 11:38  langpack-en-CA@firefox.mozilla.org.xpi
0777 lrwxrwxrwx 3.5M dustin 10 Sep 22:49  uBlock0@raymondhill.net.xpi -> /nix/store/g5q65hpidlqwnnzii4nm8wdsvsqcyq6c-home-manager-files/.mozilla/firefox/default/extensions/uBlock0@raymondhill.net.xpi
0777 lrwxrwxrwx 374k dustin 10 Sep 22:49  {3c078156-979c-498b-8990-85f7987dd929}.xpi -> /nix/store/g5q65hpidlqwnnzii4nm8wdsvsqcyq6c-home-manager-files/.mozilla/firefox/default/extensions/{3c078156-979c-498b-8990-85f7987dd929}.xpi
0777 lrwxrwxrwx 6.0k dustin 10 Sep 22:49  {6d85dea2-0fb4-4de3-9f8c-264bce9a2296}.xpi -> /nix/store/g5q65hpidlqwnnzii4nm8wdsvsqcyq6c-home-manager-files/.mozilla/firefox/default/extensions/{6d85dea2-0fb4-4de3-9f8c-264bce9a2296}.xpi
0777 lrwxrwxrwx  21M dustin 10 Sep 22:49  {d634138d-c276-4fc8-924b-40a0ea21d284}.xpi -> /nix/store/g5q65hpidlqwnnzii4nm8wdsvsqcyq6c-home-manager-files/.mozilla/firefox/default/extensions/{d634138d-c276-4fc8-924b-40a0ea21d284}.xpi

I can see my extensions are installed.

λ bat firefox/profiles.ini 
───────┬────────────────────────────────────────────────────────────────────────────────────────────
       │ File: firefox/profiles.ini
───────┼────────────────────────────────────────────────────────────────────────────────────────────
   1   │ [General]
   2   │ StartWithLastProfile=1
   3   │ 
   4   │ [Profile0]
   5   │ Default=1
   6   │ IsRelative=1
   7   │ Name=Default
   8   │ Path=default

seems to have my default profile an ID correct.

Any suggestions?

Thank you.

ah ok. It is the devedition. If I revert to the regular package, the exact same config works.

Still looking for suggestions, but this is a start.

Cheers

No clue,

But you can start it from terminal e check logs?

I had the same. There’s a couple of problems, first the different versions seem to share the same profiles.

pkgs.firefox-devedition uses the firefox executable, which is naughty. Use pkgs.firefox-devedition-bin which uses the correct firefox-developer-edition executable.

Next, to solve the profile issue simply delete ~/.mozilla and try rebuilding/launching again.

Edit: it seems this breaks future rebuilds… back to the drawing board.

On another note, running firefox-developer-edition --profile ~/.mozilla/firefox works just fine, as does firefox-developer-edition -P $username

I also experienced this issue. Switched from firefox-devedition to just firefox to fix it for now, but if someone finds a real fix I would like to use firefox-devedition again.

This is the problem of the profile naming convention:
in pkgs.firefox you would write:

profiles.default

HOWEVER,
in pkgs.firefox-devedition* you should use:

profiles.dev-edition-default