fix(firefox): take ownership of profiles.ini so the profile deploys (task 0032)

Firefox writes ~/.config/mozilla/firefox/profiles.ini itself on first launch,
pointing at an auto-created random-prefix profile. Home-manager then refuses to
clobber that file and fails the whole activation, so the declarative default
profile — search.json.mozlz4 (DuckDuckGo) and the Stylix user.js — never lands
and Firefox keeps running the stale profile with Google as default and no theme.

Set force = true on the generated profiles.ini home.file entry so home-manager
owns it, deploys the default profile, and Firefox switches to it.
This commit is contained in:
2026-07-24 08:25:04 -04:00
parent 3e64bd0b7e
commit e24f808b63

View File

@@ -15,7 +15,7 @@ in
options.modules.desktop.firefox.enable = lib.mkEnableOption "Firefox as the desktop browser"; options.modules.desktop.firefox.enable = lib.mkEnableOption "Firefox as the desktop browser";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home-manager.users.${user} = { home-manager.users.${user} = hm: {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
@@ -90,6 +90,10 @@ in
"x-scheme-handler/https" = "firefox.desktop"; "x-scheme-handler/https" = "firefox.desktop";
}; };
}; };
# Firefox writes profiles.ini itself on first launch, so home-manager is
# told to own the file rather than fail activation refusing to clobber it.
home.file."${hm.config.programs.firefox.configPath}/profiles.ini".force = true;
}; };
}; };
} }