firefox: integrate the "persist" config into "sane.programs"

This commit is contained in:
Colin 2024-02-23 11:23:41 +00:00
parent 0d8307e877
commit 62b39bf01e

View File

@ -326,7 +326,6 @@ in
// matrix: for Nheko matrix client
defaultPref("network.protocol-handler.external.matrix", true);
'';
fs."${cfg.browser.dotDir}/default".dir = {};
# 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.
fs."${cfg.browser.dotDir}/profiles.ini".symlink.text = ''
@ -344,24 +343,23 @@ in
env.PASSWORD_STORE_DIR = "/home/colin/knowledge/secrets/accounts";
# alternative to PASSWORD_STORE_DIR, but firejail doesn't handle this symlink well
# fs.".password-store".symlink.target = lib.mkIf cfg.addons.browserpass-extension.enable "knowledge/secrets/accounts";
};
})
(mkIf config.sane.programs.firefox.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}".store =
if (cfg.persistData != null) then
cfg.persistData
else
"cryptClearOnBoot"
# flush the cache to disk to avoid it taking up too much tmp.
persist.byPath."${cfg.browser.cacheDir}".store =
if (cfg.persistData != null) then
cfg.persistData
else
"cryptClearOnBoot"
;
sane.user.persist.byPath."${cfg.browser.dotDir}/default".store =
if (cfg.persistData != null) then
cfg.persistData
else
"cryptClearOnBoot"
persist.byPath."${cfg.browser.dotDir}/default".store =
if (cfg.persistData != null) then
cfg.persistData
else
"cryptClearOnBoot"
;
};
})
];
}