Skip to content

Instantly share code, notes, and snippets.

@mxxntype
Last active October 22, 2024 17:08
Show Gist options
  • Save mxxntype/df6c25e1ab3e0e19765c8e0d4573c599 to your computer and use it in GitHub Desktop.
Save mxxntype/df6c25e1ab3e0e19765c8e0d4573c599 to your computer and use it in GitHub Desktop.
Package the Zen browser for Nix, and set it as the default one
# NOTE: I manually package the Zen browser for myself.
#
# HACK: This does, however, mean that I will need to manually
# tweak the `version` and `hash` here if I wish to update it.
# This produces the package (derivation):
(let version = "1.0.0-a.37"; in pkgs.appimageTools.wrapType2 {
inherit version;
name = "zen"; # NOTE: This will be the name of the executable in $PATH.
src = pkgs.fetchurl {
url = "https://github.com/zen-browser/desktop/releases/download/${version}/zen-specific.AppImage";
hash = "sha256-QE7wA/QksNoQOFVmsV4g0qw+abz8jOUxBHsGR/s2Afc=";
};
})
# This makes the browser the default one.
xdg = {
enable = true;
desktopEntries."zen-browser" = {
name = "Zen Browser";
genericName = "Web Browser";
exec = "zen"; # NOTE: Ideally should be `"${pkgs.aeon.zen}/bin/zen"`, but that's for snowfall.
terminal = false;
mimeType = [
"text/html"
"text/xml"
];
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment