From 8c7f2ce1a87346ef711f6f0219906fd81000d597 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Fri, 1 Mar 2024 11:12:57 +1300 Subject: [PATCH] feat: Support Nix --- .gitignore | 3 ++- README.md | 8 ++++++++ shell.nix | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 shell.nix diff --git a/.gitignore b/.gitignore index b7dab5e9c..b22b1504a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -build \ No newline at end of file +build +/node diff --git a/README.md b/README.md index f0e5e3fbb..9aded4abb 100644 --- a/README.md +++ b/README.md @@ -298,6 +298,14 @@ bm-create-pr --target Add --individual flag to import layer into standalone individual config file, otherwise import into aerial map. Add --vector flag to import new layer into vector map. +## Development environment + +Prerequisite: [Nix](https://nixos.org/download/) + +When entering the project directory, run `nix-shell` to activate the development environment. + +On initial use, and when `package-lock.json` changes, run `npm i` to install Node.js packages. This will create a `node` executable in the root of the repo which you can use as the IDE interpreter. + ## Versioning and Release To publish a release, the Pull Request opened by `release-please` bot needs to be merged: diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..bb3b4fa75 --- /dev/null +++ b/shell.nix @@ -0,0 +1,18 @@ +let + pkgs = import ( + builtins.fetchTarball { + url = "https://github.com/nixos/nixpkgs/archive/d934204a0f8d9198e1e4515dd6fec76a139c87f0.tar.gz"; + sha256 = "1zfby2jsfkag275aibp81bx1g1cc305qbcy94gqw0g6zki70k1lx"; + } + ) {}; + +in + pkgs.mkShell { + packages = [ + pkgs.bashInteractive + pkgs.nodejs_20 + ]; + shellHook = '' + ln --force --no-target-directory --symbolic "${pkgs.nodejs}/bin/node" node + ''; + }