feat(desktop): move firefox config to homes and use home-manager modules
This commit is contained in:
parent
844e6b263e
commit
6897ad63c9
8 changed files with 95 additions and 90 deletions
39
homes/x86_64-linux/rafiq/desktop/browser.nix
Normal file
39
homes/x86_64-linux/rafiq/desktop/browser.nix
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue