Skip to content

Instantly share code, notes, and snippets.

@lostdj
Created March 12, 2015 16:34
Show Gist options
  • Save lostdj/d2cfdd7be2099e610512 to your computer and use it in GitHub Desktop.
Save lostdj/d2cfdd7be2099e610512 to your computer and use it in GitHub Desktop.
# default.nix
# nix-build . --run-env
{
pkgs ? (import <nixos> { inherit system; }).pkgs
, system ? builtins.currentSystem
}:
let stdenv = pkgs.stdenv;
in
stdenv.mkDerivation
{
name = "chromebin";
src = ./.;
buildInputs = with pkgs;
[
stdenv
patchelf
];
libraries = with pkgs;
[
bzip2 flac speex icu libopus
libevent expat libjpeg snappy
libpng libxml2 libxslt
xdg_utils yasm minizip libwebp
libusb1 libexif pciutils
openssl nss
nspr udev krb5
utillinux alsaLib
bison gperf
glib gtk dbus_glib
xlibs.libX11 xlibs.libXxf86vm xlibs.libXrender xlibs.libXrandr
xlibs.libXcursor xorg.libXt xorg.libXext xorg.libXtst xorg.libXi
xorg.libXinerama xorg.lndir xlibs.libXfixes xlibs.libXcomposite
xlibs.libXdamage xlibs.libXScrnSaver
mesa
protobuf speechd cups
freetype
gnome.GConf
fontconfig
pango
cairo
glib
gdk_pixbuf
gtk2
dbus
];
shellHook = with pkgs;
''
rpath=${gcc.drvAttrs.gcc}/lib
for i in $libraries; do
rpath=$rpath''${rpath:+:}$i/lib:$i/lib64
done
find . -type f | xargs -n 1 patchelf \
--interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath "$rpath"
# chown root:root opt/google/chrome/chrome-sandbox
# chmod 4755 opt/google/chrome/chrome-sandbox
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment