Merge pull request 'Adding quick dev setup using nix and direnv' (#100) from yisraeldov/keyoxide-web:nix-shell into main

Reviewed-on: https://codeberg.org/keyoxide/keyoxide-web/pulls/100
This commit is contained in:
Yarmo Mackenbach 2021-06-30 19:47:23 +02:00
commit 8bdc7c4cf6
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 node_modules
.editorconfig .editorconfig
.env .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 - directly from their [website](https://nodejs.org/en/), or
- using [nvm](https://github.com/nvm-sh/nvm): `nvm install --lts; nvm use --lts` - using [nvm](https://github.com/nvm-sh/nvm): `nvm install --lts; nvm use --lts`
- [yarn](https://yarnpkg.com/) - [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` - install dependencies with `npm install` or `yarn`
- run the server with `npm dev` or `yarn dev` - 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";
}