This package is a library for devenv, which helps building reproducible dev environments without Docker based on Nix.
devenv provides a reproducible and declarative local development environment for Neos projects. It uses the Nix package system to provide native packages for all our required services.
Status: Alpha - this is an experiment right now in replacing our Docker based development setup with Nix on Mac OS at sandstorm. Pull Requests welcome.
Supported on Mac OS only right now.
- fully reproducible dev environment based on https://devenv.sh and the Nix package manager.
- compatible with the modern way to write nix, a.k.a. nix-flakes.
- everything running fully locally; no containers involved. This makes debugging etc. a lot easier, and improves performance.
- Deep Neos integration:
- mysql auto-configured
- VIPS for image handling auto-configured
Configuration/Settings.yaml
correctly generated
- PHPStorm / IntelliJ auto-configured
- Database Connection auto-configured
- Neos plugin auto-activated
You need the Nix package manager set up; alongside with devenv.sh.
-
Install Nix via nix-installer:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
-
Ensure your
nix
installation survives OSX Updates (because of this OSX behavior): Place the following snippet at the beginning of your~/.zshrc
:# Nix if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' fi
-
Install devenv.sh. If you follow how we do it at Sandstorm via Nix Flakes and Nix profiles, you can use
Advanced (declaratively with flakes)
method described.
- run
devenv init
in your Neos project. - Update your
devenv.yaml
to look as follows:
inputs:
nixpkgs:
# or, for stable, use github:NixOS/nixpkgs
url: github:NixOS/nixpkgs/nixpkgs-unstable
# This part must be added:
devenv-neos:
url: git+https://github.com/sandstorm/devenv-neos
flake: false
imports:
# this line actually runs devenv-neos and ensures you can use these properties.
- devenv-neos
-
Update your
devenv.nix
to look as follows:{ pkgs, ... }: { # Enable Neos support (auto-configures database etc.) neos.enable = true; # add further configuration here }
You can use every devenv.sh configuration directly in the devenv.nix
file above.
See examples/full/devenv.nix for a heavily commented copy/pastable example.
- tutorial for postgres
- tutorial for adding Node.JS environment (for building assets)
- tutorial for a custom file watcher, e.g. for assets
- tutorial for elasticsearch
- tutorial for Redis support