added passFF extension

This commit is contained in:
Bryan Ramos 2024-06-19 23:04:21 -04:00
parent b92d485213
commit 6ecf0632cd
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
3 changed files with 44 additions and 6 deletions

View file

@ -5,13 +5,38 @@ let
cfg = config.modules.user.gui.browser.firefox;
in
{ options.modules.user.gui.browser.firefox = { enable = mkEnableOption "Enable Firefox browser"; };
{
options.modules.user.gui.browser.firefox = { enable = mkEnableOption "Enable Firefox browser"; };
config = mkIf cfg.enable {
programs.firefox = {
enable = true;
nativeMessagingHosts = with pkgs; [
home.packages = with pkgs; [
passff-host
];
home.file = {
".mozilla/native-messaging-hosts/passff.json" = {
text = ''
{
"name": "passff",
"description": "Host for communicating with zx2c4 pass",
"path": "${pkgs.passff-host}/share/passff-host/passff.py",
"type": "stdio",
"allowed_extensions": [ "passff@invicem.pro" ]
}
'';
};
};
assertions =
let
pinentry = config.services.gpg-agent.pinentryPackage;
in
[
{
assertion = pinentry != pkgs.pinentry-curses || pinentry != pkgs.pinentry-tty;
message = "Firefox plugin passff requires graphical pinentry";
}
];
programs.firefox = {
enable = true;
profiles = {
"default" = {
bookmarks = config.user.bookmarks;
@ -83,6 +108,7 @@ in
"browser.urlbar.suggest.history" = false;
"browser.urlbar.suggest.topsites" = false;
"browser.urlbar.sponsoredTopSites" = false;
"browser.urlbar.autoFill" = false;
"browser.toolbars.bookmarks.showOtherBookmarks" = false;
@ -260,6 +286,8 @@ in
"security.tls.version.enable-deprecated" = false;
"extensions.webcompat-reporter.enabled" = false;
"extensions.quarantinedDomains.enabled" = true;
"media.videocontrols.picture-in-picture.enabled" = false;
};
};
};

View file

@ -73,6 +73,7 @@ in
windowrulev2 = [
"float, title:(Android Emulator)"
"float, title: Extension: (PassFF)"
];
general = {

View file

@ -3,9 +3,13 @@
with lib;
let
cfg = config.modules.user.security.gpg;
gui = config.modules.user.gui.wm;
wm = {
enable = builtins.any (mod: mod.enable or false) (builtins.attrValues gui);
};
in
{ options.modules.user.security.gpg = { enable = mkEnableOption "user.security.gpg"; };
{ options.modules.user.security.gpg = { enable = mkEnableOption "Enable GPG module"; };
config = mkIf cfg.enable {
programs.gpg = {
enable = true;
@ -22,7 +26,12 @@ in
enableSshSupport = true;
enableBashIntegration = true;
enableScDaemon = true;
pinentryPackage = pkgs.pinentry-tty;
pinentryPackage =
if wm.enable then
pkgs.pinentry-gtk2
else
pkgs.pinentry-curses;
};
};
}