feat(desktop): move firefox config to homes and use home-manager modules

This commit is contained in:
Mohammad Rafiq 2025-06-14 11:52:50 +08:00
parent 844e6b263e
commit 6897ad63c9
No known key found for this signature in database
8 changed files with 95 additions and 90 deletions

View file

@ -0,0 +1,39 @@
{
lib,
inputs,
system,
}:
let
inherit (builtins) map listToAttrs;
inherit (lib.lists) findFirstIndex;
inherit (inputs.nur.legacyPackages.${system}.repos.rycee) firefox-addons;
profiles = listToAttrs (
map (name: {
inherit name;
# If there are duplicate profile names, findFirstIndex will cause issues.
value = profileCfg (findFirstIndex (x: x == name) null syncedProfiles);
}) syncedProfiles
);
syncedProfiles = [
"rafiq"
"test"
];
profileCfg = id: {
inherit id;
settings."extensions.autoDisableScopes" = 0; # Auto enable extensions
extensions = {
force = true;
packages = with firefox-addons; [
darkreader
gesturefy
sponsorblock
ublock-origin
];
};
};
in
{
home.sessionVariables.BROWSER = "firefox";
programs.firefox = { inherit profiles; };
stylix.targets.firefox.profileNames = syncedProfiles;
}