home: firefox: port to sane.programs API
This commit is contained in:
parent
8d5c917c79
commit
f6579b865b
|
@ -146,12 +146,11 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
config = mkMerge [
|
||||
({
|
||||
sane.programs.guiApps.suggestedPrograms = [ "web-browser" ];
|
||||
sane.programs.web-browser = {
|
||||
inherit package;
|
||||
# TODO: define the persistence & fs config here
|
||||
};
|
||||
sane.programs.guiApps.suggestedPrograms = [ "web-browser" ];
|
||||
|
||||
# uBlock filter list configuration.
|
||||
# specifically, enable the GDPR cookie prompt blocker.
|
||||
|
@ -161,7 +160,7 @@ in
|
|||
# the specific attribute path is found via scraping ublock code here:
|
||||
# - <https://github.com/gorhill/uBlock/blob/master/src/js/storage.js>
|
||||
# - <https://github.com/gorhill/uBlock/blob/master/assets/assets.json>
|
||||
sane.user.fs."${cfg.browser.dotDir}/managed-storage/uBlock0@raymondhill.net.json" = sane-lib.fs.wantedText ''
|
||||
fs."${cfg.browser.dotDir}/managed-storage/uBlock0@raymondhill.net.json" = sane-lib.fs.wantedText ''
|
||||
{
|
||||
"name": "uBlock0@raymondhill.net",
|
||||
"description": "ignored",
|
||||
|
@ -171,24 +170,16 @@ in
|
|||
}
|
||||
}
|
||||
'';
|
||||
sane.user.fs."${cfg.browser.dotDir}/${cfg.browser.libName}.overrides.cfg" = sane-lib.fs.wantedText ''
|
||||
fs."${cfg.browser.dotDir}/${cfg.browser.libName}.overrides.cfg" = sane-lib.fs.wantedText ''
|
||||
// if we can't query the revocation status of a SSL cert because the issuer is offline,
|
||||
// treat it as unrevoked.
|
||||
// see: <https://librewolf.net/docs/faq/#im-getting-sec_error_ocsp_server_error-what-can-i-do>
|
||||
defaultPref("security.OCSP.require", false);
|
||||
'';
|
||||
# flush the cache to disk to avoid it taking up too much tmp
|
||||
sane.user.persist.byPath."${cfg.browser.cacheDir}" = lib.mkIf (cfg.persistCache != null) {
|
||||
store = cfg.persistCache;
|
||||
};
|
||||
|
||||
sane.user.persist.byPath."${cfg.browser.dotDir}/default" = lib.mkIf (cfg.persistData != null) {
|
||||
store = cfg.persistData;
|
||||
};
|
||||
sane.user.fs."${cfg.browser.dotDir}/default" = sane-lib.fs.wantedDir;
|
||||
fs."${cfg.browser.dotDir}/default" = sane-lib.fs.wantedDir;
|
||||
# instruct Firefox to put the profile in a predictable directory (so we can do things like persist just it).
|
||||
# XXX: the directory *must* exist, even if empty; Firefox will not create the directory itself.
|
||||
sane.user.fs."${cfg.browser.dotDir}/profiles.ini" = sane-lib.fs.wantedText ''
|
||||
fs."${cfg.browser.dotDir}/profiles.ini" = sane-lib.fs.wantedText ''
|
||||
[Profile0]
|
||||
Name=default
|
||||
IsRelative=1
|
||||
|
@ -198,6 +189,18 @@ in
|
|||
[General]
|
||||
StartWithLastProfile=1
|
||||
'';
|
||||
|
||||
};
|
||||
})
|
||||
(mkIf config.sane.programs.web-browser.enabled {
|
||||
# TODO: move the persistence into the sane.programs API (above)
|
||||
# flush the cache to disk to avoid it taking up too much tmp
|
||||
sane.user.persist.byPath."${cfg.browser.cacheDir}" = lib.mkIf (cfg.persistCache != null) {
|
||||
store = cfg.persistCache;
|
||||
};
|
||||
|
||||
sane.user.persist.byPath."${cfg.browser.dotDir}/default" = lib.mkIf (cfg.persistData != null) {
|
||||
store = cfg.persistData;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user