Adding quick dev setup using nix and direnv

This commit is contained in:
🐻 Yisrael Dov Lebow 2021-06-27 11:20:00 +03:00
parent 50bc13b8e5
commit 67710a1531
No known key found for this signature in database
GPG key ID: 6AE703B3E171C686
4 changed files with 20 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use nix

1
.gitignore vendored
View file

@ -28,3 +28,4 @@
node_modules
.editorconfig
.env
/.direnv/

View file

@ -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`

16
shell.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs ? import <nixpkgs> {}}:
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";
}