blob: 208d2e7ae27d9926c9fa5cddf4cce07e58bf92c2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
{ config, pkgs, lib, ... }:
let
unwrappedFirefoxPackage = pkgs.firefox-devedition-unwrapped;
firefoxBinName = "firefox-devedition";
configDir = ".mozilla/firefox";
extensions = [
"https://addons.mozilla.org/firefox/downloads/file/3792127/firefox_dracula-1.0.xpi"
# "https://addons.mozilla.org/firefox/downloads/file/4261352/tridactyl_vim-1.24.1.xpi"
# "https://addons.mozilla.org/firefox/downloads/file/4240798/sidetabs-0.66.xpi"
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"
# dev
"https://addons.mozilla.org/firefox/downloads/file/4218479/font_inspect-0.5.8.xpi"
"https://addons.mozilla.org/firefox/downloads/file/4314064/react_devtools-5.3.1.xpi"
"https://addons.mozilla.org/firefox/downloads/file/3970625/screen_recorder-0.1.8.xpi"
# others
"https://addons.mozilla.org/firefox/downloads/file/4332776/languagetool-8.11.6.xpi"
"https://addons.mozilla.org/firefox/downloads/file/4317971/darkreader-4.9.88.xpi"
];
preferences = (import ./preferences.nix { inherit config; });
policies = lib.recursiveUpdate (import ./policies.nix { inherit config; }).policies {
Extensions.Install = extensions;
Preferences = lib.mapAttrs (_key: val: { Status = "locked"; Value = val; }) preferences;
};
firefox = pkgs.wrapFirefox unwrappedFirefoxPackage {
extraPrefs = builtins.readFile ./autoconfig.js;
};
profilePath = "default";
in {
programs.firefox = {
enable = false;
package = firefox;
# nativeMessagingHosts = [ pkgs.tridactyl-native ];
policies = policies;
};
home.packages = if config.programs.firefox.enable then [
(pkgs.writeShellScriptBin "firefox" ''exec ${firefox}/bin/${firefoxBinName}'')
] else [];
home.file = if config.programs.firefox.enable then {
# ".config/tridactyl".source = ./tridactyl;
"${configDir}/${profilePath}/chrome".source = ./chrome;
"${configDir}/profiles.ini".text = lib.generators.toINI {} {
Profile1 = {
Name = "default";
IsRelative = 1;
Path = profilePath;
};
Profile0 = {
Name = "dev-edition-default";
Default = 1;
IsRelative = 1;
Path = profilePath;
};
General = {
StartWithLastProfile = 1;
Version = 2;
};
};
} else {};
}
|