From 67710a15310e3c392e8e19065ee63519ea7aa9da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=90=BB=20Yisrael=20Dov=20Lebow?= Date: Sun, 27 Jun 2021 11:20:00 +0300 Subject: [PATCH] Adding quick dev setup using nix and direnv --- .envrc | 1 + .gitignore | 1 + README.md | 2 ++ shell.nix | 16 ++++++++++++++++ 4 files changed, 20 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/.gitignore b/.gitignore index a61f494..7e2e000 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ node_modules .editorconfig .env +/.direnv/ diff --git a/README.md b/README.md index 5bb71aa..56be4be 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ To run Keyoxide locally on your machine for development: - directly from their [website](https://nodejs.org/en/), or - using [nvm](https://github.com/nvm-sh/nvm): `nvm install --lts; nvm use --lts` - [yarn](https://yarnpkg.com/) + - [nix](https://nixos.org/guides/install-nix.html) with + [direnv](https://direnv.net/) will install yarn and other dependencies. - install dependencies with `npm install` or `yarn` - run the server with `npm dev` or `yarn dev` diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..5ebf109 --- /dev/null +++ b/shell.nix @@ -0,0 +1,16 @@ + +{ pkgs ? import {}}: +let + unstable = import (fetchTarball "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz") {}; +in +pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + nodejs + yarn + xvfb_run + unstable.cypress + ]; + + CYPRESS_INSTALL_BINARY=0; #skip installing the Cypress binary from yarn + CYPRESS_RUN_BINARY="${unstable.cypress}/bin/Cypress"; +}