From 210729017d37e35016e38eeb568e38b9538648fd 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 6e92c28d5..12afab6ad 100644 --- a/README.md +++ b/README.md @@ -310,6 +310,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..ed6dcf288 --- /dev/null +++ b/shell.nix @@ -0,0 +1,18 @@ +let + pkgs = import ( + builtins.fetchTarball { + url = "https://github.com/nixos/nixpkgs/archive/57610d2f8f0937f39dbd72251e9614b1561942d8.tar.gz"; + sha256 = "0k8az8vmfdk1n8xlza252sqk0hm1hfc7g67adin6jxqaab2s34n9"; + } + ) {}; + nodejs = pkgs.nodejs_22; +in + pkgs.mkShell { + packages = [ + pkgs.bashInteractive + nodejs + ]; + shellHook = '' + ln --force --no-target-directory --symbolic "${nodejs}/bin/node" node + ''; + }