Created
April 9, 2021 09:30
-
-
Save cryptix/9dc8806fe44f266d47f550b23b703ff8 to your computer and use it in GitHub Desktop.
NixOS Shell for cabal-desktop development
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
with import <nixpkgs> {}; | |
with pkgs; | |
let cabalEnv = buildEnv { | |
name = "cabal-desktop-env"; | |
paths = [ | |
# npm sodium stuff | |
clang | |
gnumake | |
libtool | |
autoconf | |
automake | |
m4 | |
# electron stuff | |
alsaLib | |
atk | |
at-spi2-atk | |
at-spi2-core | |
binutils | |
bzip2 | |
cairo | |
cups | |
dbus.lib | |
expat | |
fontconfig | |
freetype | |
fuse | |
gdk_pixbuf | |
glib | |
glibc | |
gtk3-x11 | |
libuuid | |
libcap | |
libgnome_keyring3 | |
libgpgerror | |
libnotify | |
libsodium | |
libappindicator-gtk3 | |
nspr | |
nss | |
pango | |
python | |
readline | |
systemd | |
udev | |
xdg_utils | |
xorg.libX11 | |
xorg.libXScrnSaver | |
xorg.libXcomposite | |
xorg.libXcursor | |
xorg.libXdamage | |
xorg.libXext | |
xorg.libXfixes | |
xorg.libXi | |
xorg.libXrandr | |
xorg.libXrender | |
xorg.libXtst | |
xorg.libxcb | |
zlib | |
]; | |
extraOutputsToInstall = [ "lib" "dev" "out" ]; | |
}; in | |
(pkgs.buildFHSUserEnv { | |
name = "cabal-desktop-chroot"; | |
targetPkgs = pkgs: (with pkgs; [ | |
nodejs-14_x | |
git | |
unzip | |
cabalEnv | |
]); | |
extraOutputsToInstall = [ "lib" "dev" "out" ]; | |
extraBuildCommands = '' | |
(cd usr/lib64 && ln -sv libbz2.so.1.0.* libbz2.so.1.0) | |
''; | |
# see to compile native modules for electron and not the nodejs of the env | |
# https://www.electronjs.org/docs/tutorial/using-native-node-modules#using-npm | |
profile = '' | |
export npm_config_cache="/tmp/cabal-desktop-npm-cache/" | |
export npm_config_devdir="/tmp/cabal-desktop-gyp/" | |
export ELECTRON_CACHE="/tmp/cabal-desktop-electron-cache/" | |
export npm_config_target=7.1.13 # from package.json | |
# The architecture of Electron, see https://electronjs.org/docs/tutorial/support#supported-platforms | |
# for supported architectures. | |
export npm_config_arch=x64 | |
export npm_config_target_arch=x64 | |
# Download headers for Electron. | |
export npm_config_disturl=https://electronjs.org/headers | |
# Tell node-pre-gyp that we are building for Electron. | |
export npm_config_runtime=electron | |
# Tell node-pre-gyp to build module from source code. | |
export npm_config_build_from_source=true | |
export CC=clang | |
export CXX=clang++ | |
export CFLAGS="$NIX_CFLAGS_COMPILE" | |
export CXXFLAGS="$NIX_CFLAGS_COMPILE" | |
export LDFLAGS="$NIX_LDFLAGS_BEFORE" | |
''; | |
}).env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's from the latest release https://github.com/cabal-club/cabal-desktop/releases/tag/v7.0.0.
https://github.com/NixOS/nixpkgs/blob/nixos-22.11/pkgs/applications/networking/browsers/vieb/default.nix is example using yarn.