From 78e590b41fe836e0b11651cb6f20b194ec4a5648 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 6 Aug 2024 18:50:44 +0200 Subject: [PATCH] add nix-shell --- .envrc | 1 + shell.nix | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .envrc create mode 100644 shell.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..1d953f4 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..840453b --- /dev/null +++ b/shell.nix @@ -0,0 +1,24 @@ +{ pkgs ? import { } }: +pkgs.mkShell { + packages = with pkgs; [ + gcc + gnumake + automake + autoconf + ]; + + env.MYSQL_DIR = toString (pkgs.symlinkJoin { + name ="libmysqlclient"; + paths = with pkgs; [ + libmysqlclient.out + libmysqlclient.dev + ]; + }); + + env.BUILD = pkgs.writeShellScript "build" '' + make maintainer-clean + autoreconf --force --install --symlink + ./configure --with-mysql="$MYSQL_DIR" --sysconfdir=$(pwd) + make + ''; +}