diff options
| author | schererleander <leander@schererleander.de> | 2025-05-08 14:24:55 +0200 |
|---|---|---|
| committer | schererleander <leander@schererleander.de> | 2025-05-08 14:24:55 +0200 |
| commit | e0bea314193d32fb3a2fd79dffccbc5468baa91e (patch) | |
| tree | 4a3eeb2a6e87f3052899f0ffab762048a1c82586 /overlays | |
| parent | 67fbdc5148475abcdbb5030298a1db80b7853605 (diff) | |
add programs
Diffstat (limited to 'overlays')
| -rw-r--r-- | overlays/minbrowser.nix | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/overlays/minbrowser.nix b/overlays/minbrowser.nix new file mode 100644 index 0000000..6017c90 --- /dev/null +++ b/overlays/minbrowser.nix @@ -0,0 +1,78 @@ +{ + lib, + stdenv, + fetchurl, + + dpkg, + autoPatchelfHook, + + libxkbcommon, + libxcb, + xorg, + alsa-lib, + nss, + at-spi2-core, + mesa, + cairo, + pango, + cups, + gtk3, + glib, + + nix-update-script, +}: + +stdenv.mkDerivation (finalAttrs: let + system = stdenv.hostPlatform.system; + + asset = if lib.strings.hasPrefix "x86_64-linux" system then { + url = "https://github.com/minbrowser/min/releases/download/v${finalAttrs.version}/min-${finalAttrs.version}-amd64.deb"; + sha256 = "sha256-gpkjGYuHwBY3IwK5bXhzIPPosSTZ67hclmGLT4PTsG4="; + } else if system == "x86_64-darwin" then { + url = "https://github.com/minbrowser/min/releases/download/v${finalAttrs.version}/min-v${finalAttrs.version}-mac-x86_64.zip"; + sha256 = ""; + } else if system == "aarch64-darwin" then { + url = "https://github.com/minbrowser/min/releases/download/v${finalAttrs.version}/min-v${finalAttrs.version}-mac-arm64.zip"; + sha256 = ""; + } else throw "Unsupported plattform: ${system}"; + in { + pname = "min"; + version = "1.34.1"; + + src = fetchurl { + url = asset.url; + hash = asset.sha256; + }; + + nativeBuildInputs = [ autoPatchelfHook ]; + nativeBuildInputs = lib.optional (lib.strings.hasPrefix "x86_64-linux" system) dpkg ++ [ autoPatchelHook ]; + + buildInputs = [ + libxkbcommon libxcb at-spi2-core mesa cairo cups gtk3 pango + alsa-lib nss glib stdenv.cc.cc.lib + ] ++ (with xorg; [ libX11 libXcomposite libXdamage libXext libXfixes libXrandr ]); + + unpackPhase = '' + ${lib.optionalString (lib.strings.hasPrefix "x86_64-linux" system) '' + dpkg-deb -x $src $out + mv $out/usr/share $out + ''} + ${lib.optionalString (system == "x86_64-darwin" || system == "aarch64-darwin") '' + unzip $src -d $out + # the zip contains e.g. Min.app; flatten: + mv $out/Min.app/Contents/* $out/ + ''} + mkdir -p $out/bin + ln -s $out/opt/Min/min $out/bin/min + ''; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Fast, minimal browser that protects your privacy"; + homepage = "https://github.com/minbrowser/min"; + changelog = "https://github.com/minbrowser/min/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ kashw2 ]; + }; +}) |
