From 18791781ea86cbec6bce8bcb847444b9c73b8b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Tue, 1 Aug 2023 17:24:11 -0700 Subject: [PATCH] browserpass: support librewolf --- modules/programs/browserpass.nix | 13 ++++++++++++- tests/modules/programs/browserpass/browserpass.nix | 9 ++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/programs/browserpass.nix b/modules/programs/browserpass.nix index 8faf5315..fd3c5ad5 100644 --- a/modules/programs/browserpass.nix +++ b/modules/programs/browserpass.nix @@ -4,7 +4,7 @@ with lib; let cfg = config.programs.browserpass; - browsers = [ "brave" "chrome" "chromium" "firefox" "vivaldi" ]; + browsers = [ "brave" "chrome" "chromium" "firefox" "librewolf" "vivaldi" ]; in { options = { programs.browserpass = { @@ -72,6 +72,17 @@ in { "${dir}/com.github.browserpass.native.json".source = "${pkgs.browserpass}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json"; }] + else if x == "librewolf" then + let + dir = if isDarwin then + "Library/Application Support/LibreWolf/NativeMessagingHosts" + else + ".librewolf/native-messaging-hosts"; + in [{ + "${dir}/com.github.browserpass.native.json".source = + "${pkgs.browserpass}/lib/browserpass/hosts/firefox/com.github.browserpass.native.json"; + }] + else if x == "vivaldi" then let dir = if isDarwin then diff --git a/tests/modules/programs/browserpass/browserpass.nix b/tests/modules/programs/browserpass/browserpass.nix index 2e1ca65e..7211c0ed 100644 --- a/tests/modules/programs/browserpass/browserpass.nix +++ b/tests/modules/programs/browserpass/browserpass.nix @@ -6,11 +6,12 @@ with lib; config = { programs.browserpass = { enable = true; - browsers = [ "brave" "chrome" "chromium" "firefox" "vivaldi" ]; + browsers = + [ "brave" "chrome" "chromium" "firefox" "librewolf" "vivaldi" ]; }; nmt.script = if pkgs.stdenv.hostPlatform.isDarwin then '' - for dir in "BraveSoftware/Brave-Browser" "Google/Chrome" "Chromium" "Mozilla" "Vivaldi"; do + for dir in "BraveSoftware/Brave-Browser" "Google/Chrome" "Chromium" "Mozilla" "LibreWolf" "Vivaldi"; do assertFileExists "home-files/Library/Application Support/$dir/NativeMessagingHosts/com.github.browserpass.native.json" done @@ -26,7 +27,9 @@ with lib; assertFileExists "home-files/.config/$dir/policies/managed/com.github.browserpass.native.json" done - assertFileExists "home-files/.mozilla/native-messaging-hosts/com.github.browserpass.native.json" + for dir in ".mozilla" ".librewolf"; do + assertFileExists "home-files/$dir/native-messaging-hosts/com.github.browserpass.native.json" + done ''; }; }