nix-config/modules/zen/default.nix
2025-12-16 19:36:20 +01:00

208 lines
6.3 KiB
Nix

{
inputs,
pkgs,
system,
...
}:
{
programs.zen-browser = {
enable = true;
nativeMessagingHosts = [ pkgs.firefoxpwa ];
policies = {
AutofillAddressEnabled = true;
AutofillCreditCardEnabled = false;
DisableAppUpdate = true;
DisableFeedbackCommands = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableTelemetry = true;
DontCheckDefaultBrowser = true;
NoDefaultBookmarks = true;
OfferToSaveLogins = false;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
};
profiles.default =
let
containers = {
Personal = {
color = "purple";
icon = "fingerprint";
id = 1;
};
};
spaces = {
"Personal" = {
id = "c6de089c-410d-4206-961d-ab11f988d40a";
position = 1000;
container = containers."Personal".id;
};
};
pins = {
"Apps" = {
id = "092abc24-d7c5-4012-b311-d4ee0b193537";
workspace = spaces.Personal.id;
container = containers.Personal.id;
isGroup = true;
isFolderCollapsed = true;
editedTitle = true;
position = 200;
};
"Mail" = {
id = "746d2753-f042-4050-89b3-d2e5f1697a90";
workspace = spaces.Personal.id;
container = containers.Personal.id;
folderParentId = pins."Apps".id;
url = "https://app.fastmail.com/mail/Inbox/?u=b88140d0";
position = 201;
};
"Finance" = {
id = "02bad3d7-7a88-4ca2-8b29-ced5f9956ac6";
workspace = spaces.Personal.id;
container = containers.Personal.id;
folderParentId = pins."Apps".id;
url = "https://finance.dnsc.io/";
position = 202;
};
"Codeberg" = {
id = "c79480bb-ad11-4bd4-b4a2-f6d9a1790278";
workspace = spaces.Personal.id;
container = containers.Personal.id;
folderParentId = pins."Apps".id;
url = "https://codeberg.org/dnscio";
position = 203;
};
"Github" = {
id = "811448b3-ac9b-4f56-b7c1-f0d5b1d25b62";
workspace = spaces.Personal.id;
container = containers.Personal.id;
folderParentId = pins."Apps".id;
url = "https://github.com/";
position = 204;
};
"Entertainment" = {
id = "969167a2-c586-4382-a6f8-a5f17df43b51";
workspace = spaces.Personal.id;
container = containers.Personal.id;
isGroup = true;
isFolderCollapsed = true;
editedTitle = true;
folderParentId = pins."Entertainment".id;
position = 300;
};
"Twitch" = {
id = "043a9077-ce81-4f6d-8f61-d2947c675eef";
workspace = spaces.Personal.id;
container = containers.Personal.id;
url = "https://www.twitch.tv/directory/following";
folderParentId = pins."Entertainment".id;
position = 301;
};
"Youtube" = {
id = "54b399ae-1106-4b91-9e2c-893e9114c215";
workspace = spaces.Personal.id;
container = containers.Personal.id;
url = "https://www.youtube.com/feed/subscriptions";
position = 302;
};
"Nix" = {
id = "02329197-7617-42e0-bc9a-1d09415ef10c";
workspace = spaces.Personal.id;
container = containers.Personal.id;
isGroup = true;
isFolderCollapsed = true;
editedTitle = true;
position = 400;
};
"Packages" = {
id = "c79480bb-ad11-4bd4-b4a2-f6d9a1790278";
workspace = spaces.Personal.id;
container = containers.Personal.id;
folderParentId = pins."Nix".id;
url = "https://search.nixos.org/packages";
position = 401;
};
"Options" = {
id = "63930b7a-d423-4a74-8edb-0179b9c9902e";
workspace = spaces.Personal.id;
container = containers.Personal.id;
folderParentId = pins."Nix".id;
url = "https://search.nixos.org/options";
position = 401;
};
"Home Manager" = {
id = "97194c72-9ab9-4310-90f8-397fd7ce626a";
workspace = spaces.Personal.id;
container = containers.Personal.id;
folderParentId = pins."Nix".id;
url = "https://home-manager-options.extranix.com";
position = 401;
};
};
in
{
containersForce = true;
pinsForce = true;
spacesForce = true;
inherit containers pins spaces;
settings = {
"layout.css.prefers-color-scheme.content-override" = 0;
};
search = {
default = "google";
force = true;
};
extensions.packages = with inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; [
ublock-origin
dearrow
bitwarden
sponsorblock
];
};
};
xdg.mimeApps =
let
value =
let
zen-browser = inputs.zen-browser.packages.${system}.beta; # or twilight
in
zen-browser.meta.desktopFileName;
associations = builtins.listToAttrs (
map
(name: {
inherit name value;
})
[
"application/x-extension-shtml"
"application/x-extension-xhtml"
"application/x-extension-html"
"application/x-extension-xht"
"application/x-extension-htm"
"x-scheme-handler/unknown"
"x-scheme-handler/mailto"
"x-scheme-handler/chrome"
"x-scheme-handler/about"
"x-scheme-handler/https"
"x-scheme-handler/http"
"application/xhtml+xml"
"application/json"
"text/plain"
"text/html"
]
);
in
{
associations.added = associations;
defaultApplications = associations;
};
}