hoodunit / hello-nix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hello, Nix

This is a set of examples to show how a single tool, the Nix package manager, can be used to install system dependencies and build projects across different languages.

Setup

Install the Nix package manager. Everything else is installed by Nix as needed. Make sure the Nix binaries are on your path, e.g. by adding ~/.nix-profile/bin to your path.

Build all languages

To build and install "Hello world" executables for Clojure, Haskell, Java, and PureScript:

nix-env -f default.nix -i '*'

To run them:

$ hello-clojure
Hello, Clojure
$ hello-purescript
Hello, PureScript
$ hello-haskell
Hello, Haskell
$ hello-java
Hello, Java

To uninstall all:

nix-env -e hello-clojure hello-haskell hello-java hello-purescript

Project-specific installation

Navigate to one of the language directories, then run any of the following commands.

Install all project dependencies and drop into a shell with those dependencies available:

nix-shell

Build the project into result/:

nix-build

Install the project locally:

nix-env -f default.nix -i '*'

About


Languages

Language:Nix 63.4%Language:Clojure 17.9%Language:Java 13.6%Language:PureScript 3.6%Language:Haskell 1.5%