mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-10 18:57:22 +00:00
Instead of having to manually stub packages that should not be downloaded we instead automatically stub all packages (except a small list of whitelisted ones). Tests can re-introduce the real package by using the `realPkgs` module argument.
32 lines
1.2 KiB
Nix
32 lines
1.2 KiB
Nix
{ realPkgs, ... }:
|
|
|
|
{
|
|
programs.browserpass = {
|
|
enable = true;
|
|
browsers = [ "brave" "chrome" "chromium" "firefox" "librewolf" "vivaldi" ];
|
|
};
|
|
|
|
nixpkgs.overlays = [ (self: super: { inherit (realPkgs) browserpass; }) ];
|
|
|
|
nmt.script = if realPkgs.stdenv.hostPlatform.isDarwin then ''
|
|
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
|
|
|
|
for dir in "Google/Chrome" "Chromium" "Vivaldi"; do
|
|
assertFileExists "home-files/Library/Application Support/$dir/policies/managed/com.github.browserpass.native.json"
|
|
done
|
|
'' else ''
|
|
for dir in "BraveSoftware/Brave-Browser" "google-chrome" "chromium" "vivaldi"; do
|
|
assertFileExists "home-files/.config/$dir/NativeMessagingHosts/com.github.browserpass.native.json"
|
|
done
|
|
|
|
for dir in "google-chrome" "chromium" "vivaldi"; do
|
|
assertFileExists "home-files/.config/$dir/policies/managed/com.github.browserpass.native.json"
|
|
done
|
|
|
|
for dir in ".mozilla" ".librewolf"; do
|
|
assertFileExists "home-files/$dir/native-messaging-hosts/com.github.browserpass.native.json"
|
|
done
|
|
'';
|
|
}
|