Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 6 additions & 26 deletions hm-module/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
lib,
...
}: let
inherit (lib) getAttrFromPath mkIf mkOption setAttrByPath;
inherit (lib) getAttrFromPath mkIf;

modulePath = [
"programs"
Expand Down Expand Up @@ -61,34 +61,15 @@ in {
(import ./mods.nix)
(import ./sine.nix {inherit mkSinePack;})
(import ./default-browser.nix {inherit name;})
(lib.mkRemovedOptionModule [
"programs"
"zen-browser"
"suppressXdgMigrationWarning"
] "The XDG migration stage has ended.")
];

options = setAttrByPath modulePath {
suppressXdgMigrationWarning = mkOption {
type = lib.types.bool;
default = false;
description = ''
Set to true to suppress the XDG config directory migration warning.
'';
};
};

config = mkIf cfg.enable {
warnings = let
migrationWarning =
if pkgs.stdenv.isLinux && !cfg.suppressXdgMigrationWarning
then ''
[Zen Browser] Starting from release 18.18.6b, the configuration directory
has changed from ~/.zen to ~/.config/zen.

If you haven't migrated yet, please follow the migration guide:
https://github.com/0xc000022070/zen-browser-flake#missing-configuration-after-update

To suppress this warning after completing the migration, set:
programs.zen-browser.suppressXdgMigrationWarning = true;
''
else null;

essentialPinsWarning = let
hasIssue = lib.any (
profile:
Expand All @@ -107,7 +88,6 @@ in {
else null;
in
lib.filter (w: w != null) [
migrationWarning
essentialPinsWarning
];

Expand Down
1 change: 0 additions & 1 deletion tests/default-browser.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

programs.zen-browser = {
enable = true;
suppressXdgMigrationWarning = true;
setAsDefaultBrowser = true;
};

Expand Down
5 changes: 1 addition & 4 deletions tests/enable-beta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
homeModule = {
imports = [zen-browser-flake.homeModules.beta];

programs.zen-browser = {
enable = true;
suppressXdgMigrationWarning = true;
};
programs.zen-browser.enable = true;
};

testScript = '' # python
Expand Down
2 changes: 0 additions & 2 deletions tests/pins-persistent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

programs.zen-browser = {
enable = true;
suppressXdgMigrationWarning = true;

profiles.default = {
pins = {
"Test Pin" = {
Expand Down