From d219f7674b2c970e8dd1b1ab5c24a4e1f31fe722 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 22 Jul 2020 09:50:48 +0200 Subject: Add shell.nix for development environment Signed-off-by: Matthias Beyer --- shell.nix | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..3f696be --- /dev/null +++ b/shell.nix @@ -0,0 +1,65 @@ +{ ... }: + +let + pkgs = import { }; + + shell-configure = pkgs.writeShellScriptBin "configure" '' + mkdir -p build + cd build + cmake .. "$@" + ''; + + shell-build = pkgs.writeShellScriptBin "build" '' + if [ ! -d "build" ]; then + >&2 echo "First you have to run configure." + exit 1 + fi + cd build + cmake --build . --parallel $NIX_BUILD_CORES "$@" + ''; + + shell-run = pkgs.writeShellScriptBin "run" '' + if [ ! -f "build/astroid" ]; then + >&2 echo "First you have to run build." + exit 1 + fi + build/astroid "@" + ''; + + shell-debug = pkgs.writeShellScriptBin "debug" '' + if [ ! -f "build/astroid" ]; then + >&2 echo "First you have to run build." + exit 1 + fi + gdb --args ./build/astroid "$@" + ''; + +in +pkgs.mkShell { + buildInputs = with pkgs; [ + shell-configure + shell-build + shell-run + shell-debug + + boost + cmake + glib-networking protobuf + gmime3 + gnome3.adwaita-icon-theme + gsettings-desktop-schemas + gtkmm3 + libpeas + libsass + notmuch + pkgconfig + python3 + python3Packages.pygobject3 + ronn + webkitgtk + wrapGAppsHook + ]; + + LIBCLANG_PATH = "${pkgs.llvmPackages.libclang}/lib"; +} + -- cgit v1.2.3