Added Zen config

This commit is contained in:
Alexandre 2026-02-07 21:07:23 +01:00
parent fddf5a4f28
commit 8d539d344e
6 changed files with 112 additions and 2 deletions

23
flake.lock generated
View File

@ -663,7 +663,8 @@
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"sops-nix": "sops-nix",
"spicetify-nix": "spicetify-nix"
"spicetify-nix": "spicetify-nix",
"zen-browser": "zen-browser"
}
},
"sops-nix": {
@ -811,6 +812,26 @@
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
},
"zen-browser": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1770438797,
"narHash": "sha256-pwnQTmZswF6bu2/Ie7ajOo8w6rXQwVI954S9WX1UG3w=",
"owner": "youwen5",
"repo": "zen-browser-flake",
"rev": "d396599774bdbafeb86c122dc2c422c7084ea390",
"type": "github"
},
"original": {
"owner": "youwen5",
"repo": "zen-browser-flake",
"type": "github"
}
}
},
"root": "root",

View File

@ -32,6 +32,11 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:youwen5/zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nix-darwin ,nixpkgs, ... }@inputs: {

View File

@ -9,6 +9,7 @@ in
inputs.spicetify-nix.homeManagerModules.spicetify
modules.hm.spicetify
modules.hm.zed
modules.hm.zen
modules.hm.shell
];

View File

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, inputs, ... }:
{
environment = {
systemPackages = with pkgs; [
@ -19,6 +19,8 @@
gnupg
cmatrix
gh
# Browser
inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default
];
variables = {
EDITOR = "nvim";

View File

@ -18,6 +18,7 @@
shell = ./home-manager/shell.nix;
spicetify = ./home-manager/spicetify.nix;
zed = ./home-manager/zed.nix;
zen = ./home-manager/zen.nix;
};
nixos = {

View File

@ -0,0 +1,80 @@
{
inputs,
pkgs,
lib,
...
}:
let
extension = shortId: guid: {
name = guid;
value = {
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "normal_installed";
};
};
prefs = {
# Check these out at about:config
"extensions.autoDisableScopes" = 0;
"extensions.pocket.enabled" = false;
# ...
};
extensions = [
# 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 go to https://addons.mozilla.org/api/v5/addons/addon/!SHORT_ID!/ to get the guid
(extension "ublock-origin" "uBlock0@raymondhill.net")
# ...
];
in
{
environment.systemPackages = [
(pkgs.wrapFirefox
inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.zen-browser-unwrapped
{
extraPrefs = lib.concatLines (
lib.mapAttrsToList (
name: value: ''lockPref(${lib.strings.toJSON name}, ${lib.strings.toJSON value});''
) prefs
);
extraPolicies = {
DisableTelemetry = true;
ExtensionSettings = builtins.listToAttrs extensions;
SearchEngines = {
Default = "ddg";
Add = [
{
Name = "nixpkgs packages";
URLTemplate = "https://search.nixos.org/packages?query={searchTerms}";
IconURL = "https://wiki.nixos.org/favicon.ico";
Alias = "@np";
}
{
Name = "NixOS options";
URLTemplate = "https://search.nixos.org/options?query={searchTerms}";
IconURL = "https://wiki.nixos.org/favicon.ico";
Alias = "@no";
}
{
Name = "NixOS Wiki";
URLTemplate = "https://wiki.nixos.org/w/index.php?search={searchTerms}";
IconURL = "https://wiki.nixos.org/favicon.ico";
Alias = "@nw";
}
{
Name = "noogle";
URLTemplate = "https://noogle.dev/q?term={searchTerms}";
IconURL = "https://noogle.dev/favicon.ico";
Alias = "@ng";
}
];
};
};
}
)
];
}