-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
default.nix
80 lines (74 loc) · 2.07 KB
/
default.nix
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
74
75
76
77
78
79
80
{
config,
nixpkgs,
...
}: {
environment.systemPackages = [
nixpkgs.brave
(nixpkgs.writeShellScriptBin "browser" ''
brave "$@"
'')
];
systemd.services."machine-browser-user-data-dir" = {
path = [nixpkgs.util-linux];
# Brave uses this specific path for their config
environment.USER_DATA_DIR = "/home/${config.wellKnown.username}/.config/BraveSoftware/Brave-Browser";
serviceConfig = {
ExecStart = nixpkgs.writeShellScript "exec-start.sh" ''
set -eux
mkdir -p "$USER_DATA_DIR"
chown ${nixpkgs.lib.escapeShellArg config.wellKnown.username} "$USER_DATA_DIR"
mount --bind /data/browser/data "$USER_DATA_DIR"
'';
ExecStop = nixpkgs.writeShellScript "exec-stop.sh" ''
set -eux
umount "$USER_DATA_DIR"
'';
RemainAfterExit = true;
Type = "oneshot";
};
unitConfig = {
After = ["multi-user.target"];
};
requiredBy = ["graphical.target"];
};
programs.chromium.enable = true;
# https://chromeenterprise.google/policies/
programs.chromium.extraOpts = {
BookmarkBarEnabled = true;
BrowserSignin = 0;
DefaultBrowserSettingEnabled = false;
DefaultSearchProviderEnabled = true;
DefaultSearchProviderSearchURL = "https://duckduckgo.com/?q={searchTerms}";
ExtensionInstallForcelist = [
"kbfnbcaeplbcioakkpcpgfkobkghlhen" # Grammarly: Grammar Checker and Writing App
"hdokiejnpimakedhajhdlcegeplioahd" # LastPass: Free Password Manager
];
HighContrastEnabled = true;
ImportBookmarks = false;
ManagedBookmarks = [
{toplevel_name = "Links";}
{
name = "Nix";
children = [
{
name = "nixos-forum";
url = "https://discourse.nixos.org/latest";
}
];
}
{
name = "Rust";
children = [
{
name = "forum";
url = "https://users.rust-lang.org";
}
];
}
];
PasswordManagerEnabled = false;
ShowAppsShortcutInBookmarkBar = false;
SyncDisabled = true;
};
}