refactor: moved modules to legacy-modules
This commit is contained in:
parent
d646b954ac
commit
db7ac35613
233 changed files with 5 additions and 5 deletions
41
legacy-modules/home-manager-modules/programs/firefox.nix
Normal file
41
legacy-modules/home-manager-modules/programs/firefox.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
buildProfilePersistence = profile: {
|
||||
directories = [
|
||||
".mozilla/firefox/${profile}/extensions"
|
||||
];
|
||||
files = [
|
||||
".mozilla/firefox/${profile}/cookies.sqlite"
|
||||
".mozilla/firefox/${profile}/favicons.sqlite"
|
||||
# Permissions and ${profileName} levels for each site
|
||||
".mozilla/firefox/${profile}/permissions.sqlite"
|
||||
".mozilla/firefox/${profile}/content-prefs.sqlite"
|
||||
# Browser history and bookmarks
|
||||
".mozilla/firefox/${profile}/places.sqlite"
|
||||
# I guess this is useful?
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1511384
|
||||
# https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria
|
||||
".mozilla/firefox/${profile}/storage.sqlite"
|
||||
# Extension configuration
|
||||
".mozilla/firefox/${profile}/extension-settings.json"
|
||||
];
|
||||
};
|
||||
in {
|
||||
config = lib.mkIf (config.programs.firefox.enable && config.impermanence.enable) {
|
||||
home.persistence."${config.impermanence.persistencePath}" = lib.mkMerge (
|
||||
(
|
||||
lib.attrsets.mapAttrsToList
|
||||
(profile: _: buildProfilePersistence profile)
|
||||
config.programs.firefox.profiles
|
||||
)
|
||||
++ (
|
||||
lib.lists.optional
|
||||
((builtins.length (lib.attrsets.mapAttrsToList (key: value: value) config.programs.firefox.profiles)) == 0)
|
||||
(buildProfilePersistence "default")
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue