browserpass: support librewolf

This commit is contained in:
Robert Schütz 2023-08-01 17:24:11 -07:00 committed by Robert Helgesson
parent da6874e8bb
commit 18791781ea
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 18 additions and 4 deletions

View file

@ -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

View file

@ -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
'';
};
}