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

@ -3,6 +3,7 @@
inputs,
osConfig,
lib,
system,
...
}:
let
@ -26,6 +27,7 @@ let
in
{
config = mkMerge [
(mkIf osConfig.desktop.enable (import ./desktop { inherit lib inputs system; }))
(mkIf osConfig.desktop.enable {
home.persistence."/persist/home/rafiq".directories = [
"docs"

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;
}

View file

@ -0,0 +1,12 @@
{
lib,
inputs,
system,
...
}:
let
inherit (lib) mkMerge;
in
mkMerge [
(import ./browser.nix { inherit lib inputs system; })
]