diff --git a/flake.nix b/flake.nix index 361e99b..cc8d34b 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,8 @@ ip-whitelist.url = "github:Oak-Digital/nixos-ip-whitelist-firewall"; nix-homebrew.url = "github:zhaofengli/nix-homebrew"; zellij-switch.url = "github:mostafaqanbaryan/zellij-switch"; + zen-browser.url = "github:0xc000022070/zen-browser-flake"; + firefox-addons.url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; }; outputs = diff --git a/home/linux.nix b/home/linux.nix index 0ff007c..ca34029 100644 --- a/home/linux.nix +++ b/home/linux.nix @@ -46,8 +46,10 @@ ../modules/nvim ../modules/ghostty ../modules/fish + ../modules/zellij ../modules/mpv ../modules/firefox + ../modules/zen ../modules/wm/swaync ../modules/wm/cliphist ../modules/wm/awww diff --git a/hosts/dnsc-machine/default.nix b/hosts/dnsc-machine/default.nix index 7f968da..9afceaa 100644 --- a/hosts/dnsc-machine/default.nix +++ b/hosts/dnsc-machine/default.nix @@ -57,6 +57,7 @@ users = { dennis = { imports = [ + inputs.zen-browser.homeModules.beta inputs.ironbar.homeManagerModules.default ../../home/linux.nix ]; diff --git a/modules/zen/default.nix b/modules/zen/default.nix new file mode 100644 index 0000000..bc72cba --- /dev/null +++ b/modules/zen/default.nix @@ -0,0 +1,97 @@ +{ + inputs, + config, + 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 = { + containersForce = true; + containers = { + Personal = { + color = "purple"; + icon = "fingerprint"; + id = 1; + }; + }; + spacesForce = true; + spaces = + let + containers = config.programs.zen-browser.profiles."default".containers; + in + { + "Space" = { + id = "c6de089c-410d-4206-961d-ab11f988d40a"; + position = 1000; + container = containers."Personal".id; + }; + }; + extensions.packages = with inputs.firefox-addons.packages.${pkgs.stdenv.hostPlatform.system}; [ + ublock-origin + dearrow + "bitwarden-2025.11.2" + "sponsorblock-6.1.0" + ]; + }; + }; + + 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; + }; +}