From 87cf098372d441c718ede095df181462f6456a27 Mon Sep 17 00:00:00 2001 From: cookiez Date: Wed, 13 Aug 2025 16:34:46 +0200 Subject: [PATCH] Added declarative Zen Browser config, via Flake. Removed unused configuration files. --- flake.lock | 32 +++++++++++++--- flake.nix | 6 +-- home.nix | 85 +++++++++++++++++++++++++++++++++++++++-- other/bookmarks-default | 12 ------ other/sway-config | 3 -- virtual-machine.nix | 30 --------------- zen.nix | 55 -------------------------- 7 files changed, 110 insertions(+), 113 deletions(-) delete mode 100644 other/bookmarks-default delete mode 100644 other/sway-config delete mode 100644 virtual-machine.nix delete mode 100644 zen.nix diff --git a/flake.lock b/flake.lock index 885b901..8ca4402 100644 --- a/flake.lock +++ b/flake.lock @@ -39,6 +39,27 @@ "type": "github" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "zen-browser", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754974548, + "narHash": "sha256-XMjUjKD/QRPcqUnmSDczSYdw46SilnG0+wkho654DFM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "27a26be51ff0162a8f67660239f9407dba68d7c5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1755078863, @@ -99,20 +120,21 @@ }, "zen-browser": { "inputs": { + "home-manager": "home-manager_2", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1754886070, - "narHash": "sha256-MZDmxOkVKL1HY72bliN8Gxh0SYkHUa3W/1fTU2ke36I=", - "owner": "youwen5", + "lastModified": 1755055213, + "narHash": "sha256-smOMNJ6ZM4mKvYB2z1Dbfkttr9fnjqeLT9bqRwn/L1U=", + "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "e37d2b326311320c8571111b3ef89b29d26d4b64", + "rev": "6391f8217d75b9f72b8c77572246937323ed90bc", "type": "github" }, "original": { - "owner": "youwen5", + "owner": "0xc000022070", "repo": "zen-browser-flake", "type": "github" } diff --git a/flake.nix b/flake.nix index 6eeb6df..d1c6e87 100644 --- a/flake.nix +++ b/flake.nix @@ -7,8 +7,7 @@ home-manager.url = "github:nix-community/home-manager/release-25.05"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; - #zen-browser.url = "github:MarceColl/zen-browser-flake"; - zen-browser.url = "github:youwen5/zen-browser-flake"; + zen-browser.url = "github:0xc000022070/zen-browser-flake"; zen-browser.inputs.nixpkgs.follows = "nixpkgs"; grub2-themes = { url = "github:vinceliuice/grub2-themes"; }; @@ -70,8 +69,6 @@ ./firefox.nix ./zsh.nix ./autostart.nix - #./virtual-machine.nix - #./zen.nix #./neovim.nix ./packages.nix ./lockscreen.nix @@ -81,6 +78,7 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.users.${username} = ./home.nix; + home-manager.backupFileExtension = "backup"; # Automatically backs up conflicting files during activation home-manager.extraSpecialArgs = { inherit inputs username version; system = "x86_64-linux"; }; } ]; diff --git a/home.nix b/home.nix index 1773ac3..ab8cb36 100644 --- a/home.nix +++ b/home.nix @@ -6,6 +6,12 @@ home.username = username; home.homeDirectory = "/home/${username}"; + imports = [ + inputs.zen-browser.homeModules.beta + # or inputs.zen-browser.homeModules.twilight + # or inputs.zen-browser.homeModules.twilight-official + ]; + # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage # when a new Home Manager release introduces backwards @@ -18,11 +24,82 @@ # Let Home Manager install and manage itself. programs = { - home-manager.enable = true; - git = { - enable = true; + home-manager = { enable = true; }; + + git = { + enable = true; userName = "Cookiez"; userEmail = "jaden-puerkenauer@web.de"; - }; + }; + + zen-browser = { + enable = true; + #package = inputs.zen-browser.packages.${pkgs.system}.default; + profiles = { + ${username} = { + id = 0; + name = username; + # profileAvatarPath = "chrome://browser/content/zen-avatars/avatar-57.svg"; + path = "${username}.default"; + isDefault = true; + settings = { + + }; + }; + }; + policies = { + AutofillAddressEnabled = false; + AutofillCreditCardEnabled = false; + PasswordManagerEnabled = false; + NoDefaultBookmarks = true; + DisableAppUpdate = true; + DisableFirefoxStudies = true; + DontCheckDefaultBrowser = true; + EnableTrackingProtection = { + Value = true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + OfferToSaveLogins = false; + DisplayBookmarksToolbar = "always"; # alternatives: "always" or "newtab" + + ExtensionSettings = + with builtins; + let + extension = shortId: uuid: { + name = uuid; + value = { + install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; + installation_mode = "force_installed"; + }; + }; + in + listToAttrs [ + (extension "ublock-origin" "uBlock0@raymondhill.net") + (extension "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}") + #(extension "2fas-two-factor-authentication" "admin@2fas.com") + (extension "sponsorblock" "sponsorBlocker@ajay.app") + #(extension "dearrow" "deArrow@ajay.app") + #(extension "enhancer-for-youtube" "enhancerforyoutube@maximerf.addons.mozilla.org") + #(extension "tabliss" "extension@tabliss.io") + #(extension "don-t-fuck-with-paste" "DontFuckWithPaste@raim.ist") + #(extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}") + #(extension "react-devtools" "@react-devtools") + (extension "keepa" "amptra@keepa.com") + (extension "redditUntranslate" "reddit-url-redirector@kichkoupi.com") + ]; + # To add additional extensions, find it on addons.mozilla.org, find + # the short ID in the url (like https=//addons.mozilla.org/en-US/firefox/addon/!SHORT_ID!/) + # Then, download the XPI by filling it in to the install_url template, unzip it, + # run `jq .browser_specific_settings.gecko.id manifest.json` or + # `jq .applications.gecko.id manifest.json` to get the UUID + Preferences = { + #"browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; + "browser.urlbar.showSearchSuggestionsFirst" = false; + "browser.sessionstore.resume_session_once" = false; + }; + }; + }; }; } diff --git a/other/bookmarks-default b/other/bookmarks-default deleted file mode 100644 index ae37bab..0000000 --- a/other/bookmarks-default +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - name = "Bookmarks Toolbar"; - toolbar = true; - bookmarks = [ - { - name = "NixOS Packages"; - url = "https://search.nixos.org/packages"; - } - ]; - } -] diff --git a/other/sway-config b/other/sway-config deleted file mode 100644 index 0d96d73..0000000 --- a/other/sway-config +++ /dev/null @@ -1,3 +0,0 @@ -input * { - xkb_layout de -} diff --git a/virtual-machine.nix b/virtual-machine.nix deleted file mode 100644 index 7f2cf67..0000000 --- a/virtual-machine.nix +++ /dev/null @@ -1,30 +0,0 @@ -{config, pkgs, ... }: -{ - programs.dconf.enable = true; - - users.users.cookiez.extraGroups = [ "libvirtd" ]; - - environment.systemPackages = with pkgs; [ - virt-manager - virt-viewer - spice - spice-gtk - spice-protocol - win-virtio - win-spice - gnome.adwaita-icon-theme - ]; - - virtualisation = { - libvirtd = { - enable = true; - qemu = { - swtpm.enable = true; - ovmf.enable = true; - ovmf.packages = [ pkgs.OVMFFull.fd ]; - }; - }; - spiceUSBRedirection.enable = true; - }; - services.spice-vdagentd.enable = true; -} diff --git a/zen.nix b/zen.nix deleted file mode 100644 index 7cee2fd..0000000 --- a/zen.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ config, pkgs, inputs, ... }: -let - username = "cookiez"; -in -{ - #Copy from https://github.com/0x006E/dotfiles/blob/main/home.nix - zen-browser = { - enable = true; - package = inputs.zen-browser.packages.${pkgs.system}.default; - profiles = { - ${username} = { - id = 0; - name = "${username}"; - # profileAvatarPath = "chrome://browser/content/zen-avatars/avatar-57.svg"; - path = "${username}.default"; - isDefault = true; - settings = { - - }; - }; - }; - policies = { - PasswordManagerEnabled = false; - ExtensionSettings = - with builtins; - let - extension = shortId: uuid: { - name = uuid; - value = { - install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi"; - installation_mode = "normal_installed"; - }; - }; - in - listToAttrs [ - (extension "ublock-origin" "uBlock0@raymondhill.net") - (extension "bitwarden-password-manager" "{446900e4-71c2-419f-a6a7-df9c091e268b}") - #(extension "2fas-two-factor-authentication" "admin@2fas.com") - (extension "sponsorblock" "sponsorBlocker@ajay.app") - #(extension "dearrow" "deArrow@ajay.app") - #(extension "enhancer-for-youtube" "enhancerforyoutube@maximerf.addons.mozilla.org") - #(extension "tabliss" "extension@tabliss.io") - #(extension "don-t-fuck-with-paste" "DontFuckWithPaste@raim.ist") - #(extension "clearurls" "{74145f27-f039-47ce-a470-a662b129930a}") - #(extension "react-devtools" "@react-devtools") - (extension "keepa" "amptra@keepa.com") - ]; - # To add additional extensions, find it on addons.mozilla.org, find - # the short ID in the url (like https=//addons.mozilla.org/en-US/firefox/addon/!SHORT_ID!/) - # Then, download the XPI by filling it in to the install_url template, unzip it, - # run `jq .browser_specific_settings.gecko.id manifest.json` or - # `jq .applications.gecko.id manifest.json` to get the UUID - }; - }; -}