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 = {
|
sane.programs.web-browser = {
|
||||||
inherit package;
|
inherit package;
|
||||||
# TODO: define the persistence & fs config here
|
|
||||||
};
|
|
||||||
sane.programs.guiApps.suggestedPrograms = [ "web-browser" ];
|
|
||||||
|
|
||||||
# uBlock filter list configuration.
|
# uBlock filter list configuration.
|
||||||
# specifically, enable the GDPR cookie prompt blocker.
|
# specifically, enable the GDPR cookie prompt blocker.
|
||||||
|
@ -161,7 +160,7 @@ in
|
||||||
# the specific attribute path is found via scraping ublock code here:
|
# 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/src/js/storage.js>
|
||||||
# - <https://github.com/gorhill/uBlock/blob/master/assets/assets.json>
|
# - <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",
|
"name": "uBlock0@raymondhill.net",
|
||||||
"description": "ignored",
|
"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,
|
// if we can't query the revocation status of a SSL cert because the issuer is offline,
|
||||||
// treat it as unrevoked.
|
// treat it as unrevoked.
|
||||||
// see: <https://librewolf.net/docs/faq/#im-getting-sec_error_ocsp_server_error-what-can-i-do>
|
// see: <https://librewolf.net/docs/faq/#im-getting-sec_error_ocsp_server_error-what-can-i-do>
|
||||||
defaultPref("security.OCSP.require", false);
|
defaultPref("security.OCSP.require", false);
|
||||||
'';
|
'';
|
||||||
# flush the cache to disk to avoid it taking up too much tmp
|
fs."${cfg.browser.dotDir}/default" = sane-lib.fs.wantedDir;
|
||||||
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;
|
|
||||||
# instruct Firefox to put the profile in a predictable directory (so we can do things like persist just it).
|
# 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.
|
# 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]
|
[Profile0]
|
||||||
Name=default
|
Name=default
|
||||||
IsRelative=1
|
IsRelative=1
|
||||||
|
@ -198,6 +189,18 @@ in
|
||||||
[General]
|
[General]
|
||||||
StartWithLastProfile=1
|
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