Last active
December 15, 2015 16:59
-
-
Save garbas/5293558 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
.installed.cfg | |
bin/ | |
eggs/ | |
include/ | |
lib/ | |
nixenv | |
parts/ |
This file contains hidden or 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
git clone https://gist.github.com/5293558.git plone | |
cd plone | |
# if you dont have nix installed do | |
sh ./install_nix.sh | |
# installs plone via nix | |
make | |
# use buildout as before (there is buildout.cfg for you to change) | |
bin/buildout |
This file contains hidden or 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
[buildout] | |
extends = http://dist.plone.org/release/4.3.1/versions.cfg | |
eggs-directory = eggs | |
versions = versions | |
unzip = true | |
parts = | |
zeo | |
instance | |
varnish | |
[zeo] | |
recipe = plone.recipe.zeoserver | |
[instance] | |
recipe = plone.recipe.zope2instance | |
user = admin:admin | |
zeo-client = on | |
debug-mode = on | |
verbose-security = on | |
eggs = | |
Pillow | |
Plone | |
[varnish] | |
recipe = plone.recipe.varnish | |
daemon = ${buildout:directory}/nixenv/sbin/varnishd | |
bind = 127.0.0.1:8000 | |
backends = 127.0.0.1:8080 | |
cache-size = 256M | |
[versions] | |
zc.buildout = 1.7.1 | |
distribute = 0.6.34 | |
plone.recipe.zope2instance = 4.2.11 | |
plone.recipe.zeoserver = 1.2.6 | |
plone.recipe.varnish = 1.3dev |
This file contains hidden or 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
ARCH=`uname -m` | |
ARCH_SYS=`uname -s | tr "[A-Z]" "[a-z]"` | |
VERSION=1.5.1pre3069_8057a19 | |
NAME=nix-${VERSION}-${ARCH}-${ARCH_SYS} | |
if [ "$ARCH" = "i686" -a "$ARCH_SYS" = "freebsd" ] | |
then | |
DOWNLOAD_URL=http://hydra.nixos.org/build/4256488/download/1/${NAME}.tar.bz2 | |
elif [ "$ARCH" = "i686" -a "$ARCH_SYS" = "linux" ] | |
then | |
DOWNLOAD_URL=http://hydra.nixos.org/build/4256480/download/1/${NAME}.tar.bz2 | |
elif [ "$ARCH" = "i686" -a "$ARCH_SYS" = "linux" ] | |
then | |
DOWNLOAD_URL= | |
elif [ "$ARCH" = "x86_64" -a "$ARCH_SYS" = "darwin" ] | |
then | |
DOWNLOAD_URL=http://hydra.nixos.org/build/4256485/download/1/${NAME}.tar.bz2 | |
elif [ "$ARCH" = "x86_64" -a "$ARCH_SYS" = "freebsd" ] | |
then | |
DOWNLOAD_URL=http://hydra.nixos.org/build/4256487/download/1/${NAME}.tar.bz2 | |
elif [ "$ARCH" = "x86_64" -a "$ARCH_SYS" = "linux" ] | |
then | |
DOWNLOAD_URL=http://hydra.nixos.org/build/4256479/download/1/${NAME}.tar.bz2 | |
else | |
echo "Platform detected: ${ARCH_SYS} ${ARCH}" | |
echo "Platform not supported!" | |
exit 1 | |
fi | |
echo "Platform detected: ${ARCH_SYS} ${ARCH}" | |
echo "Downloading Nix for your platform..." | |
WORK_DIR=`pwd` | |
curl -O $DOWNLOAD_URL | |
#echo "There are XXX steps to install Nix, you will be prompt for each step to confirm it" | |
#echo "[1/XXX] sudo tar xfj $WORK_DIR/${NAME}.tar.bz2 -C /" | |
#read confirm | |
sudo tar xfj $WORK_DIR/${NAME}.tar.bz2 -C / | |
sudo chown -R $USER /nix | |
/usr/bin/nix-finish-install | |
sudo rm /usr/bin/nix-finish-install | |
source $HOME/.nix-profile/etc/profile.d/nix.sh | |
cd $WORK_DIR | |
echo "Adding and updating Nix Packages (unstable) channel." | |
nix-channel --add http://nixos.org/channels/nixpkgs-unstable | |
if which make >/dev/null; then | |
echo "'make' command detected." | |
else | |
nix-env -iA nixpkgs.gnumake | |
fi | |
echo "" | |
echo "" | |
echo "" | |
echo "========================================================================" | |
echo "" | |
echo "Make sure to source Nix user profile:" | |
echo " echo \"source $HOME/.nix-profile/etc/profile.d/nix.sh\" >> ~/.profile" | |
echo "" | |
echo "And to run Plone you will need to setup \$LANG/\$LC_ALL:" | |
echo " echo \"export LANG=\\\"en_US.UTF-8\\\"\" >> ~/.profile" | |
echo " echo \"export LC_ALL=\\\"en_US.UTF-8\\\"\" >> ~/.profile" | |
echo "" | |
echo "========================================================================" | |
echo " ... happy Nix-ing!" |
This file contains hidden or 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_PATH=~/.nix-defexpr/channels/ | |
all: plone.nix | |
nix-channel --update | |
NIX_PATH=${NIX_PATH} nix-build --out-link nixenv plone.nix | |
./nixenv/bin/virtualenv --distribute --clear . | |
echo ../../../nixenv/lib/python2.7/site-packages > lib/python2.7/site-packages/nixenv.pth | |
./bin/easy_install -H "" zc.buildout | |
print-python-syspath: | |
./bin/python -c 'import sys,pprint;pprint.pprint(sys.path)' | |
.PHONY: print-syspath |
This file contains hidden or 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
{ }: | |
let | |
pkgs = import <nixpkgs> { }; | |
in | |
with pkgs; | |
buildEnv { | |
name = "plone-bootstrap"; | |
paths = [ | |
haproxy | |
varnish | |
python27 | |
python27Packages.distribute | |
python27Packages.recursivePthLoader | |
python27Packages.virtualenv | |
plone43Packages.plone | |
plone43Packages.pillow | |
plone43Packages.mailinglogger | |
plone43Packages.plone_recipe_zope2instance | |
plone43Packages.plone_recipe_zeoserver | |
plone43Packages.plone_recipe_varnish | |
plone43Packages.collective_recipe_template | |
plone43Packages.collective_recipe_filestorage | |
plone43Packages.zc_recipe_egg | |
] ++ lib.attrValues python27.modules; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment