2019-08-18 10:57:30 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
lib.mkIf config.test.enableBig {
|
|
|
|
programs.firefox = {
|
|
|
|
enable = true;
|
|
|
|
profiles.basic.isDefault = true;
|
2021-05-24 17:28:12 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
profiles.test = {
|
|
|
|
id = 1;
|
|
|
|
settings = { "general.smoothScroll" = false; };
|
|
|
|
};
|
2021-09-29 08:39:17 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
profiles.bookmarks = {
|
|
|
|
id = 2;
|
|
|
|
settings = { "general.smoothScroll" = false; };
|
2022-06-20 16:58:26 +02:00
|
|
|
bookmarks = [
|
2022-07-22 15:32:45 +02:00
|
|
|
{
|
|
|
|
toolbar = true;
|
|
|
|
bookmarks = [{
|
|
|
|
name = "Home Manager";
|
|
|
|
url = "https://nixos.wiki/wiki/Home_Manager";
|
|
|
|
}];
|
|
|
|
}
|
2022-06-20 16:58:26 +02:00
|
|
|
{
|
|
|
|
name = "wikipedia";
|
2022-01-02 10:22:50 +01:00
|
|
|
keyword = "wiki";
|
|
|
|
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
|
2022-06-20 16:58:26 +02:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "kernel.org";
|
|
|
|
url = "https://www.kernel.org";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "Nix sites";
|
|
|
|
bookmarks = [
|
|
|
|
{
|
|
|
|
name = "homepage";
|
|
|
|
url = "https://nixos.org/";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "wiki";
|
|
|
|
url = "https://nixos.wiki/";
|
|
|
|
}
|
2022-08-27 03:28:57 +02:00
|
|
|
{
|
|
|
|
name = "Nix sites";
|
|
|
|
bookmarks = [
|
|
|
|
{
|
|
|
|
name = "homepage";
|
|
|
|
url = "https://nixos.org/";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "wiki";
|
|
|
|
url = "https://nixos.wiki/";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
2022-06-20 16:58:26 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
2019-08-18 10:57:30 +02:00
|
|
|
};
|
2022-01-02 10:22:50 +01:00
|
|
|
};
|
2019-08-18 10:57:30 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
nixpkgs.overlays = [
|
|
|
|
(self: super: {
|
|
|
|
firefox-unwrapped = pkgs.runCommand "firefox-0" {
|
|
|
|
meta.description = "I pretend to be Firefox";
|
|
|
|
preferLocalBuild = true;
|
|
|
|
passthru.gtk3 = null;
|
|
|
|
} ''
|
|
|
|
mkdir -p "$out"/{bin,lib}
|
|
|
|
touch "$out/bin/firefox"
|
|
|
|
chmod 755 "$out/bin/firefox"
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
2019-10-08 22:46:27 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
nmt.script = ''
|
|
|
|
assertFileRegex \
|
|
|
|
home-path/bin/firefox \
|
|
|
|
MOZ_APP_LAUNCHER
|
2019-08-18 10:57:30 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
assertDirectoryExists home-files/.mozilla/firefox/basic
|
2021-05-24 17:28:12 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
assertFileContent \
|
|
|
|
home-files/.mozilla/firefox/test/user.js \
|
|
|
|
${./profile-settings-expected-user.js}
|
2021-09-29 08:39:17 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
bookmarksUserJs=$(normalizeStorePaths \
|
|
|
|
home-files/.mozilla/firefox/bookmarks/user.js)
|
2021-09-29 08:39:17 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
assertFileContent \
|
|
|
|
$bookmarksUserJs \
|
|
|
|
${./profile-settings-expected-bookmarks-user.js}
|
2021-09-29 08:39:17 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
bookmarksFile="$(sed -n \
|
|
|
|
'/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \
|
|
|
|
$TESTED/home-files/.mozilla/firefox/bookmarks/user.js)"
|
2021-09-29 08:39:17 +02:00
|
|
|
|
2022-01-02 10:22:50 +01:00
|
|
|
assertFileContent \
|
|
|
|
$bookmarksFile \
|
|
|
|
${./profile-settings-expected-bookmarks.html}
|
|
|
|
'';
|
2019-08-18 10:57:30 +02:00
|
|
|
}
|