aboutsummaryrefslogtreecommitdiff
path: root/profiles/disablePasswordManager.nix
diff options
context:
space:
mode:
authortilpner2020-06-15 09:53:06 +0200
committertilpner2020-06-15 09:53:06 +0200
commit367b0c114f38d5c332f5ee971ad13dd69e302dec (patch)
treeec0c5ee3e7e1f0a30517599e51bd0c8172635158 /profiles/disablePasswordManager.nix
parent2992d92e6ce0d7c96ccded0747d8815d8cfed956 (diff)
downloadfirefox-profiles-367b0c114f38d5c332f5ee971ad13dd69e302dec.tar.gz
firefox-profiles-367b0c114f38d5c332f5ee971ad13dd69e302dec.tar.xz
firefox-profiles-367b0c114f38d5c332f5ee971ad13dd69e302dec.zip
WIP towards module based configuration
Diffstat (limited to 'profiles/disablePasswordManager.nix')
-rw-r--r--profiles/disablePasswordManager.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/profiles/disablePasswordManager.nix b/profiles/disablePasswordManager.nix
new file mode 100644
index 0000000..cf71db6
--- /dev/null
+++ b/profiles/disablePasswordManager.nix
@@ -0,0 +1,37 @@
+{ config, lib, ... }: with lib; {
+ options.features.disablePasswordManager = mkOption {
+ type = types.bool;
+ default = false;
+ description = ''
+ Prevent the user from storing any passwords in the browser.
+ This can be justified if the physical security of the device is uncertain, or
+ if the provider wants to avoid the responsiblity of storing such sensitive data.
+
+ However, the users alternatives must be considered: what will a user do without the
+ password manager?
+
+ Possible "alternatives" (from user perspective) include:
+ - Choose much weaker passwords
+ - Store the passwords in an unencrypted form (e.g. on the desktop)
+ '';
+ };
+
+ config = mkMerge [
+ (mkIf config.features.disablePasswordManager {
+ policies = {
+ # TODO: how exactly are passwords stored?
+ OfferToSaveLogins = false;
+ PasswordManagerEnabled = false;
+ };
+ })
+
+ (mkIf (!config.features.disablePasswordManager) {
+ preferences = {
+ # Ask for password every 15 minutes
+ security.ask_for_password = 2;
+ security.password_lifetime = 15; # minutes
+ signon.masterPasswordReprompt.timeout_ms = 15 * 60 * 1000;
+ };
+ })
+ ];
+}