diff --git a/flake.lock b/flake.lock index e8e9285..f64c8cd 100644 --- a/flake.lock +++ b/flake.lock @@ -525,7 +525,8 @@ "nix-homebrew": "nix-homebrew", "nixos-mailserver": "nixos-mailserver", "nixpkgs": "nixpkgs_4", - "themes": "themes" + "themes": "themes", + "zen-browser": "zen-browser" } }, "rust-analyzer-src": { @@ -604,6 +605,29 @@ "repo": "ThemeNix", "type": "github" } + }, + "zen-browser": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1753933355, + "narHash": "sha256-4QxMcKS6oc+cG8efwwAin4M+YOokBak1dVS8u5P3b5M=", + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "rev": "fa795a139a8c92b140bc21f11f61da1c97ad5b1d", + "type": "github" + }, + "original": { + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ef8c264..38175bc 100644 --- a/flake.nix +++ b/flake.nix @@ -62,6 +62,13 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + zen-browser = { + url = "github:0xc000022070/zen-browser-flake"; + + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + agenix = { url = "github:ryantm/agenix"; @@ -118,7 +125,7 @@ |> map ({ name, value }: nameValuePair name value.config) |> listToAttrs; in hostsByType // hostConfigs // { - inherit lib; + inherit inputs lib; herculesCI = { ... }: { ciSystems = [ "aarch64-linux" "x86_64-linux" ]; diff --git a/lib/system.nix b/lib/system.nix index cec5a59..ca63027 100644 --- a/lib/system.nix +++ b/lib/system.nix @@ -11,6 +11,7 @@ inputs: self: super: let |> filter (hasAttrByPath path) |> map (getAttrFromPath path); + inputHomeModules = collectInputs [ "homeModules" "default" ]; inputModulesLinux = collectInputs [ "nixosModules" "default" ]; inputModulesDarwin = collectInputs [ "darwinModules" "default" ]; @@ -30,6 +31,10 @@ in { modules = [ module overlayModule + + { + home-manager.sharedModules = inputHomeModules; + } ] ++ modulesCommon ++ modulesLinux ++ inputModulesLinux; @@ -41,6 +46,10 @@ in { modules = [ module overlayModule + + { + home-manager.sharedModules = inputHomeModules; + } ] ++ modulesCommon ++ modulesDarwin ++ inputModulesDarwin; diff --git a/modules/common/zen-browser.nix b/modules/common/zen-browser.nix new file mode 100644 index 0000000..9af84bc --- /dev/null +++ b/modules/common/zen-browser.nix @@ -0,0 +1,63 @@ +{ lib, ... }: let + inherit (lib) enabled merge; + + lockedAs = Value: merge { + inherit Value; + Locked = true; + }; + + locked = merge { Locked = true; }; +in { + home-manager.sharedModules = [{ + programs.zen-browser = enabled { + # package = mkIf config.isDarwin null; + + policies = { + AutofillAddressEnabled = false; + AutofillCreditCardEnabled = false; + + DisableAppUpdate = true; + DisableFeedbackCommands = true; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + + # We want Zen to be the default browser. + DontCheckDefaultBrowser = false; + + NoDefaultBookmarks = true; + + # I accept the terms of use. + SkipTermsOfUse = true; + + PictureInPicture = lockedAs false; + + Homepage.StartPage = "previous-session"; + + EnableTrackingProtection = lockedAs true { + Cryptomining = true; + EmailTracking = true; + Fingerprinting = true; + }; + + UserMessaging = locked { + ExtensionRecommendations = false; + FeatureRecommendations = false; + FirefoxLabs = false; + MoreFromMozilla = false; + SkipOnboarding = true; + }; + + FirefoxSuggest = locked { + ImproveSuggest = false; + SponsoredSuggestions = false; + WebSuggestions = false; + }; + }; + + # policies.Preferences = { + + # }; + }; + }]; +} diff --git a/modules/darwin/dock.nix b/modules/darwin/dock.nix index 4acdc08..40806a9 100644 --- a/modules/darwin/dock.nix +++ b/modules/darwin/dock.nix @@ -1,4 +1,4 @@ -{ +{ config, ... }: { system.defaults.dock = { autohide = true; showhidden = true; # Translucent. @@ -14,7 +14,8 @@ enable-spring-load-actions-on-all-items = true; persistent-apps = [ - { app = "/Applications/Zen.app"; } + { app = "${config.home-manager.users.${config.system.primaryUser} + .programs.zen-browser.package}/Applications/Zen Browser (Beta).app"; } { app = "/Applications/Ghostty.app"; } ]; }; diff --git a/modules/darwin/paperwm.nix b/modules/darwin/paperwm.nix index 7f2428e..93645d2 100644 --- a/modules/darwin/paperwm.nix +++ b/modules/darwin/paperwm.nix @@ -225,7 +225,7 @@ in { hs.hotkey.bind(super, "f", PaperWM.actions.toggle_floating) -- APPLICATIONS - hs.hotkey.bind(super, "w", function() hs.application.launchOrFocus("Zen") end) + hs.hotkey.bind(super, "w", function() hs.application.launchOrFocus("Zen Browser (Beta)") end) hs.hotkey.bind(super, "return", function() hs.application.launchOrFocus("Ghostty") end) hs.hotkey.bind(super, "t", function() hs.application.launchOrFocus("Finder") end)