1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-04-13 15:57:47 +00:00
home-manager/tests/modules/programs/firefox/profiles/containers/default.nix
Ihar Hrachyshka d3ebdb59a3 tests: Enable firefox tests for darwin
This change also removes checks for MOZ_APP_LAUNCHER set for wrapped
package: the wrapped binary is in a different location on Darwin; but
the check seems out of place for Home Manager since it doesn't control
exact variables set by nixpkgs package.

This change also removes handling of state version < 19.09 when the
firefox package was not wrapped. It's time to clean up.

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-03-19 10:15:13 -04:00

30 lines
778 B
Nix

modulePath:
{ config, lib, pkgs, ... }:
let firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath;
in {
imports = [ firefoxMockOverlay ];
config = lib.mkIf config.test.enableBig (lib.setAttrByPath modulePath {
enable = true;
profiles.containers = {
containers = {
"shopping" = {
icon = "circle";
color = "yellow";
};
};
};
} // {
nmt.script = let
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
profilePath = if isDarwin then
"Library/Application Support/Firefox/Profiles"
else
".mozilla/firefox";
in ''
assertFileContent \
"home-files/${profilePath}/containers/containers.json" \
${./expected-containers.json}
'';
});
}