-
-
Save LnL7/8c84382f5cfd61fa49e3b01da2bca0a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import nixpkgs {} | |
, nixpkgs ? builtins.fetchTarball { | |
url = "https://releases.nixos.org/nixpkgs/nixpkgs-20.03pre206743.af57b17404e/nixexprs.tar.xz"; | |
sha256 = "0zksmczv3lyaldr4m7p1ziam0hxiafbngamli9fmzzjql2vvy0ra"; | |
} | |
}: | |
with pkgs; | |
stdenv.mkDerivation rec { | |
name = "firefox-${version}"; | |
version = "71.0"; | |
buildInputs = [ undmg unzip ]; | |
sourceRoot = "."; | |
phases = [ "unpackPhase" "installPhase" ]; | |
installPhase = '' | |
mkdir -p "$out/Applications" | |
cp -r Firefox.app "$out/Applications/firefox.app" | |
mkdir -p "$out/bin" | |
cp -r "$out/Applications/firefox.app/Contents/MacOS/firefox" \ | |
"$out/bin/firefox" | |
''; | |
src = fetchurl { | |
name = "firefox-${version}.dmg"; | |
url = "https://download-installer.cdn.mozilla.net/pub/firefox/releases/${version}/mac/en-GB/Firefox%20${version}.dmg"; | |
sha256 = "1kknqpsymh9jyvabhvg47bjgbazji7kpacxdvp9pb97gsv73fym8"; | |
}; | |
meta = with stdenv.lib; { | |
description = "The Firefox web browser"; | |
homepage = https://www.mozilla.org/en-GB/firefox; | |
maintainers = with maintainers; [ cmacrae ]; | |
platforms = platforms.darwin; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nix-build firefox.nix | |
$ ls -l /nix/store/12p7g0a28rg3prs7xdvv9qpnn0mgkki7-firefox-71.0/Applications/firefox.app/Contents/MacOS/firefox | |
-r-xr-xr-x 1 root wheel 36688 Jan 1 1970 /nix/store/12p7g0a28rg3prs7xdvv9qpnn0mgkki7-firefox-71.0/Applications/firefox.app/Contents/MacOS/firefox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment