programs: add zen-browser
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
786c090767
commit
4b8f74564d
6 changed files with 109 additions and 0 deletions
|
@ -63,6 +63,11 @@
|
||||||
# TODO: Remove when on stable
|
# TODO: Remove when on stable
|
||||||
ghostty = unstable.ghostty;
|
ghostty = unstable.ghostty;
|
||||||
|
|
||||||
|
# TODO: Use official package when available
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/327982
|
||||||
|
zen-browser = inputs.zen-browser.packages.${pkgs.system}.zen-browser;
|
||||||
|
zen-browser-unwrapped = inputs.zen-browser.packages.${pkgs.system}.zen-browser-unwrapped;
|
||||||
|
|
||||||
### Python
|
### Python
|
||||||
# https://nixos.org/manual/nixpkgs/unstable/#how-to-override-a-python-package-for-all-python-versions-using-extensions
|
# https://nixos.org/manual/nixpkgs/unstable/#how-to-override-a-python-package-for-all-python-versions-using-extensions
|
||||||
#?? PKG = pyprev.PKG.overridePythonAttrs {};
|
#?? PKG = pyprev.PKG.overridePythonAttrs {};
|
||||||
|
@ -171,6 +176,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
|
# FIXME: Separate root from sharedModules
|
||||||
root = {
|
root = {
|
||||||
# Inherit from user
|
# Inherit from user
|
||||||
programs.home-manager.enable = config.home-manager.users.${config.custom.username}.programs.home-manager.enable;
|
programs.home-manager.enable = config.home-manager.users.${config.custom.username}.programs.home-manager.enable;
|
||||||
|
|
25
flake.in.nix
25
flake.in.nix
|
@ -68,6 +68,7 @@
|
||||||
nixgl-unstable = flake "github:nix-community/nixGL" // unstable "nixpkgs";
|
nixgl-unstable = flake "github:nix-community/nixGL" // unstable "nixpkgs";
|
||||||
stylix-unstable = flake "github:danth/stylix" // unstable "nixpkgs";
|
stylix-unstable = flake "github:danth/stylix" // unstable "nixpkgs";
|
||||||
walker = flake "github:abenz1267/walker?ref=v0.12.8" // unstable "nixpkgs";
|
walker = flake "github:abenz1267/walker?ref=v0.12.8" // unstable "nixpkgs";
|
||||||
|
zen-browser = flake "github:youwen5/zen-browser-flake" // unstable "nixpkgs";
|
||||||
|
|
||||||
### Branches
|
### Branches
|
||||||
nixpkgs-master = flake "github:NixOS/nixpkgs/master";
|
nixpkgs-master = flake "github:NixOS/nixpkgs/master";
|
||||||
|
@ -140,6 +141,30 @@
|
||||||
inputs.anyrun.homeManagerModules.default
|
inputs.anyrun.homeManagerModules.default
|
||||||
inputs.nix-flatpak.homeManagerModules.nix-flatpak
|
inputs.nix-flatpak.homeManagerModules.nix-flatpak
|
||||||
inputs.walker.homeManagerModules.default
|
inputs.walker.homeManagerModules.default
|
||||||
|
|
||||||
|
# TODO: Use official module when supported
|
||||||
|
# https://github.com/nix-community/home-manager/blob/master/modules/programs/floorp.nix
|
||||||
|
(let
|
||||||
|
modulePath = ["programs" "zen-browser"];
|
||||||
|
mkFirefoxModule = import "${inputs."home-manager-${branch}"}/modules/programs/firefox/mkFirefoxModule.nix";
|
||||||
|
in
|
||||||
|
mkFirefoxModule {
|
||||||
|
inherit modulePath;
|
||||||
|
name = "Zen";
|
||||||
|
wrappedPackageName = "zen-browser";
|
||||||
|
unwrappedPackageName = "zen-browser-unwrapped";
|
||||||
|
visible = true;
|
||||||
|
|
||||||
|
platforms.linux = {
|
||||||
|
configPath = ".zen";
|
||||||
|
vendorPath = ".mozilla";
|
||||||
|
};
|
||||||
|
|
||||||
|
platforms.darwin = {
|
||||||
|
configPath = "Library/Application Support/Zen";
|
||||||
|
vendorPath = "Library/Application Support/Mozilla";
|
||||||
|
};
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
# Branch-specific overlays
|
# Branch-specific overlays
|
||||||
|
|
|
@ -164,6 +164,10 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
url = "github:abenz1267/walker?ref=v0.12.8";
|
url = "github:abenz1267/walker?ref=v0.12.8";
|
||||||
};
|
};
|
||||||
|
zen-browser = {
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
|
url = "github:youwen5/zen-browser-flake";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
outputs = inputs: inputs.flakegen ./flake.in.nix inputs;
|
outputs = inputs: inputs.flakegen ./flake.in.nix inputs;
|
||||||
}
|
}
|
|
@ -210,6 +210,7 @@ in {
|
||||||
(class "^firefox.*$" rules)
|
(class "^firefox.*$" rules)
|
||||||
(class "^google-chrome$" rules)
|
(class "^google-chrome$" rules)
|
||||||
(class "^vivaldi.*$" rules)
|
(class "^vivaldi.*$" rules)
|
||||||
|
(class "^zen$" rules)
|
||||||
];
|
];
|
||||||
|
|
||||||
clipboard = rules: [
|
clipboard = rules: [
|
||||||
|
|
|
@ -42,6 +42,7 @@ with lib; {
|
||||||
nautilus.enable = true;
|
nautilus.enable = true;
|
||||||
nvtop.enable = true;
|
nvtop.enable = true;
|
||||||
wezterm.enable = true;
|
wezterm.enable = true;
|
||||||
|
zen-browser.enable = true;
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf config.custom.full {
|
(mkIf config.custom.full {
|
||||||
|
|
72
options/custom/programs/firefox/zen-browser.nix
Normal file
72
options/custom/programs/firefox/zen-browser.nix
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.custom.programs.zen-browser;
|
||||||
|
in {
|
||||||
|
options.custom.programs.zen-browser = {
|
||||||
|
enable = mkOption {default = false;};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home-manager.sharedModules = [
|
||||||
|
{
|
||||||
|
# https://zen-browser.app/
|
||||||
|
# https://github.com/youwen5/zen-browser-flake
|
||||||
|
programs.zen-browser = mkMerge [
|
||||||
|
(import "${inputs.self}/modules/firefox.nix" {
|
||||||
|
inherit config inputs lib pkgs;
|
||||||
|
|
||||||
|
# TODO: Revisit Zen themes
|
||||||
|
theme = false;
|
||||||
|
})
|
||||||
|
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
profiles.default.settings = {
|
||||||
|
"zen.pinned-tab-manager.close-shortcut-behavior" = "reset-unload-switch";
|
||||||
|
"zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url" = true;
|
||||||
|
"zen.tab-unloader.timeout-minutes" = 60;
|
||||||
|
"zen.theme.accent-color" = "#d33682";
|
||||||
|
"zen.theme.color-prefs.colorful" = false;
|
||||||
|
"zen.theme.color-prefs.use-workspace-colors" = true;
|
||||||
|
"zen.theme.pill-button" = true;
|
||||||
|
"zen.urlbar.replace-newtab" = false;
|
||||||
|
"zen.view.compact.hide-toolbar" = true;
|
||||||
|
"zen.view.sidebar-expanded" = false;
|
||||||
|
"zen.view.use-single-toolbar" = false;
|
||||||
|
"zen.welcome-screen.seen" = true;
|
||||||
|
"zen.workspaces.container-specific-essentials-enabled" = true;
|
||||||
|
"zen.workspaces.force-container-workspace" = true;
|
||||||
|
"zen.workspaces.hide-deactivated-workspaces" = true;
|
||||||
|
"zen.workspaces.individual-pinned-tabs" = false;
|
||||||
|
"zen.workspaces.show-icon-strip" = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
home = {
|
||||||
|
activation = {
|
||||||
|
# HACK: Zen only recognizes profiles that include the ZenAvatarPath key
|
||||||
|
update-zen-browser-profile = lib.home-manager.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
|
run sed -i \
|
||||||
|
's|\[Profile\([0-9]*\)\]|[Profile\1]\nZenAvatarPath=chrome://browser/content/zen-avatars/avatar-95.svg|' \
|
||||||
|
"$HOME/.zen/profiles.ini"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
file = {
|
||||||
|
".zen/profiles.ini" = {
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue