Last active
September 5, 2015 20:11
-
-
Save brodul/ee7662b89c1e395463a4 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
{ | |
packageOverrides = pkgs: rec { | |
atom = | |
with pkgs; | |
let | |
atomEnv = buildEnv { | |
name = "env-atom"; | |
paths = [ | |
stdenv.gcc.gcc zlib glib dbus gtk atk pango freetype libgnome_keyring3 | |
fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gnome.GConf nss | |
xlibs.libXrender xlibs.libX11 xlibs.libXext xlibs.libXdamage xlibs.libXtst | |
xlibs.libXcomposite xlibs.libXi xlibs.libXfixes xlibs.libXrandr | |
xlibs.libXcursor libcap systemd | |
]; | |
}; | |
in stdenv.mkDerivation rec { | |
name = "atom-${version}"; | |
version = "1.0.9"; | |
src = fetchurl { | |
url = "https://github.com/atom/atom/releases/download/v${version}/atom-amd64.deb"; | |
sha256 = "06lqrccrq725m3jl4psff3acfqfygiaaw6p8pda9wwqp43widqjd"; | |
name = "${name}.deb"; | |
}; | |
buildInputs = [ atomEnv makeWrapper ]; | |
phases = [ "installPhase" "fixupPhase" ]; | |
installPhase = '' | |
mkdir -p $out | |
ar p $src data.tar.gz | tar -C $out -xz ./usr | |
substituteInPlace $out/usr/share/applications/atom.desktop \ | |
--replace /usr/share/atom $out/bin | |
mv $out/usr/* $out/ | |
rm -r $out/share/lintian | |
rm -r $out/usr/ | |
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ | |
$out/share/atom/atom | |
patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \ | |
$out/share/atom/resources/app/apm/bin/node | |
wrapProgram $out/bin/atom \ | |
--prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64" | |
wrapProgram $out/bin/apm \ | |
--prefix "LD_LIBRARY_PATH" : "${atomEnv}/lib:${atomEnv}/lib64" | |
''; | |
meta = with stdenv.lib; { | |
description = "A hackable text editor for the 21st Century"; | |
homepage = https://atom.io/; | |
license = licenses.mit; | |
maintainers = [ maintainers.offline ]; | |
platforms = [ "x86_64-linux" ]; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment