mirror of
https://github.com/zephrynis/nix-flake.git
synced 2026-02-18 20:21:53 +00:00
Add initial Nix flake configuration for PC and Laptop with Home Manager support
- Create flake.nix to define NixOS configurations for PC and Laptop - Add README.md with setup instructions and layout overview - Implement common NixOS settings in modules/common.nix - Configure Home Manager for user-specific settings in home/users/user/home.nix - Set up hardware configurations for both PC and Laptop - Enable Home Manager integration in host configurations - Introduce Zen Browser package definition
This commit is contained in:
114
packages/zen-browser.nix
Normal file
114
packages/zen-browser.nix
Normal file
@@ -0,0 +1,114 @@
|
||||
{ buildMozillaMach
|
||||
, buildNpmPackage
|
||||
, fetchFromGitHub
|
||||
, lib
|
||||
, fetchurl
|
||||
, git
|
||||
, pkg-config
|
||||
, python3
|
||||
, vips
|
||||
, runtimeShell
|
||||
, writeScriptBin
|
||||
, ... }:
|
||||
|
||||
let
|
||||
zenVersion = "1.12.5b";
|
||||
firefoxVersion = "138.0.3";
|
||||
|
||||
firefoxSrc = fetchurl {
|
||||
url = "https://archive.mozilla.org/pub/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.xz";
|
||||
hash = "sha256-on86tB1jWyodhBgonR3tzWy1MhSMfWPT+Ll8ZkRVE+Q=";
|
||||
};
|
||||
|
||||
patchedSrc = buildNpmPackage {
|
||||
pname = "firefox-zen-browser-src-patched";
|
||||
version = zenVersion;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zen-browser";
|
||||
repo = "desktop";
|
||||
tag = zenVersion;
|
||||
hash = "sha256-6CovYcJBbR9QtcNqZEC4tmukWTqra1b4VepmO21TwhM=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
postUnpack = ''
|
||||
tar xf ${firefoxSrc}
|
||||
mkdir -p source/engine
|
||||
mv firefox-${firefoxVersion} source/engine
|
||||
'';
|
||||
|
||||
npmDepsHash = "sha256-NwX8+gpz66dl70QyvEETTgTwyAtlv+OaqGtgpeCvvUY=";
|
||||
|
||||
makeCacheWritable = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
git
|
||||
python3
|
||||
pkg-config
|
||||
(writeScriptBin "sips" ''
|
||||
#!${runtimeShell}
|
||||
echo >&2 "$@"
|
||||
'')
|
||||
(writeScriptBin "iconutil" ''
|
||||
#!${runtimeShell}
|
||||
echo >&2 "$@"
|
||||
'')
|
||||
];
|
||||
|
||||
buildInputs = [ vips ];
|
||||
|
||||
buildPhase = ''
|
||||
npm run surfer ci --brand release --display-version ${zenVersion}
|
||||
npm run import
|
||||
python ./scripts/update_en_US_packs.py
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp -r engine $out
|
||||
|
||||
cd $out
|
||||
for i in $(find . -type l); do
|
||||
realpath=$(readlink $i)
|
||||
rm $i
|
||||
cp $realpath $i
|
||||
done
|
||||
'';
|
||||
|
||||
dontFixup = true;
|
||||
};
|
||||
in
|
||||
(
|
||||
(buildMozillaMach {
|
||||
pname = "zen-browser";
|
||||
packageVersion = zenVersion;
|
||||
version = firefoxVersion;
|
||||
applicationName = "Zen Browser";
|
||||
binaryName = "zen";
|
||||
branding = "browser/branding/release";
|
||||
requireSigning = false;
|
||||
allowAddonSideload = true;
|
||||
|
||||
src = patchedSrc;
|
||||
|
||||
extraConfigureFlags = [ "--with-app-basename=Zen" ];
|
||||
|
||||
meta = {
|
||||
description = "Firefox based browser with a focus on privacy and customization";
|
||||
homepage = "https://zen-browser.app/";
|
||||
downloadPage = "https://zen-browser.app/download/";
|
||||
changelog = "https://zen-browser.app/release-notes/#${zenVersion}";
|
||||
license = lib.licenses.mpl20;
|
||||
maintainers = with lib.maintainers; [ matthewpi titaniumtown eveeifyeve ];
|
||||
broken = true;
|
||||
platforms = lib.platforms.unix;
|
||||
mainProgram = "zen";
|
||||
};
|
||||
}).override {
|
||||
pgoSupport = false;
|
||||
crashreporterSupport = false;
|
||||
enableOfficialBranding = false;
|
||||
}
|
||||
).overrideAttrs (prev: {
|
||||
patches = builtins.filter (p: !(lib.hasInfix "firefox-mac-missing-vector-header.patch" p)) prev.patches;
|
||||
})
|
||||
Reference in New Issue
Block a user