Graffiti development environment with Nix
Thanks to the myriad interpreted languages at our disposal, creating a
terminal program on Unix can be as easy as adding the appropriate
#!
-line to a text file, then marking the file as executable. Now, we bring
the same simplicity to building GUI apps, thanks to Graffiti, Node.js, and Nix.
Step 1. Preparation
Clone this repository:
git clone https://github.com/egasimus/graffiti-nix
cd graffiti-nix
Install Nix package manager:
Try it out:
./01-tutorial.js
Step 2. Hello Graffiti
Graffiti lets you build beautiful GUI apps using familiar Web technologies. Unlike Electron or NW.js, Graffiti does not bundle an entire browser engine - it just gives you a lightweight DOM environment. This means it's faster and more secure, yet can still run familiar frameworks like React or Mithril.
Graffiti is a native Node.js module, written in Rust. Thanks to Nix, you don't have to manually install Node or Rust, or compile Graffiti. In a new directory, run:
touch hello-world
chmod +x hello-world
Then open hello-world
with your favorite file, and paste this:
Save it, and run it.