Mailvelope

Revision as of 20:51, 15 June 2026 by Railwhale (talk | contribs) (Create Mailvelope, with install instructions and how to use with GPG)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Mailvelope is a browser extension for using PGP-based end-to-end encryption with webmail clients

Installation

Mailvelope can be installed manually from Firefox Add-ons or the Chrome Web Store.

Via Home-Manager

Many Firefox add-ons are packaged in the Nix User Repository, in rycee's repo.

This allows you to install them declaratively:

{ pkgs, ... }: {
  # Change to your browser
  programs.librewolf = {
    profiles.<profile-name> = {
      extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [
        mailvelope
      ];
    };
  };
}

Usage

Using with GnuPG

Mailvelope supports using your system's GnuPG rather than the built-in `OpenPGP.js`.

To allow communication between mailvelope and GnuPG, it must be allowed via native messaging hosts.

To allow it for Firefox-based browsers, add this to your Home Manager configuration:

{ pkgs, lib, ... }: {
  # Change to your browser
  programs.librewolf = {
    nativeMessagingHosts = with pkgs; [
      # for mailvelope
      (writeTextDir "lib/mozilla/native-messaging-hosts/gpgmejson.json" ''
        {
          "name": "gpgmejson",
          "description": "JavaScript binding for GnuPG",
          "path": "${lib.getExe' pkgs.gpgme.dev "gpgme-json"}",
          "type": "stdio",
          "allowed_extensions": ["jid1-AQqSMBYb0a8ADg@jetpack"]
        }
      '')
    ];
  };
}

Or to your NixOS configuration via programs.firefox.nativeMessagingHosts.packages.

The json is based on the upstream recommendation