From 7f5c1fae2af2da2ed645ebc6fc85046430b1c6d0 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 | 17 +++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 shell.nix diff --git a/.gitignore b/.gitignore index 4e6c00db..46007e22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules build -json-schema-cache \ No newline at end of file +json-schema-cache +/node diff --git a/README.md b/README.md index 91825f1a..d056170f 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,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 00000000..ac45d558 --- /dev/null +++ b/shell.nix @@ -0,0 +1,17 @@ +let + pkgs = import (builtins.fetchTarball { + name = "nixos-unstable-2024-09-17"; + url = "https://github.com/nixos/nixpkgs/archive/345c263f2f53a3710abe117f28a5cb86d0ba4059.tar.gz"; + sha256 = "1llzyzw7a0jqdn7p3px0sqa35jg24v5pklwxdybwbmbyr2q8cf5j"; + }) { }; + nodejs = pkgs.nodejs; +in +pkgs.mkShell { + packages = [ + pkgs.bashInteractive + nodejs + ]; + shellHook = '' + ln --force --no-target-directory --symbolic "${nodejs}/bin/node" node + ''; +}