Skip to content

Latest commit

 

History

History
executable file
·
67 lines (47 loc) · 2.27 KB

README.md

File metadata and controls

executable file
·
67 lines (47 loc) · 2.27 KB

web-project

This repo is a skeleton layout for a clientside web-app project using:

It is forked from nix-project, which uses Nix for system package management (Node and Yarn).

Clone it, amend this README, and update the packages in package.json.

Setup

This project requires nix to be globally installed.

It also requires direnv, to be globally installed, which can be done through Nix.

Once both are installed, direnv allow on this project directory will take care of everything else.

Nix

Install nix.

Platform Command
MacOS sh <(curl -L https://nixos.org/nix/install)
Linux sh <(curl -L https://nixos.org/nix/install) --daemon
Windows (WSL) sh <(curl -L https://nixos.org/nix/install) --no-daemon

direnv

Install direnv and nix-direnv.

nix-env -iA nixpkgs.direnv
nix-env -iA nixpkgs.nix-direnv

Hook direnv into your shell.

Shell Command
Bash echo 'if hash direnv; then eval "$(direnv hook bash)"; fi' >>~/.bash_profile
Zsh echo 'if hash direnv; then eval "$(direnv hook zsh)"; fi' >>~/.zshrc

Project

After checking out this project, run:

direnv allow

This will execute .envrc (which will activate the nix-shell) when you cd into this project. The first time you do this, the dev environment will be downloaded and installed by nix.

Finally, run

yarn

to install all the application packages, then add and commit the generated yarn.lock.

Build

The full list of commands can be found in package.json.

yarn build

This will emit the app and static assets in dist/index.html.