View Code? Open in Web Editor
NEW
Haskell and nix example project
License: BSD 3-Clause "New" or "Revised" License
Makefile 14.73%
Haskell 7.27%
Nix 78.01%
haskell-nix-example's Introduction
haskell-nix-example
Steps to reproduce
λ mkdir my-project && cd $_
λ nix-shell --packages ghc --run 'cabal init'
- answer
cabal init
CLI questions
- copy
default.nix
, pkgs.nix
, release.nix
and shell.nix
files
- copy
Makefile
, but update run
to use the project's executable name
- pin
nixpkgs
and save to a .json
file
- using latest commit sha:
λ nix-prefetch-git https://github.com/NixOS/nixpkgs.git > nixpkgs.json
- or at a specific one:
λ nix-prefetch-git https://github.com/NixOS/nixpkgs.git 05z8iqgpv0pzrwxvjkjwn03kz07dq2y4bv9wdclb2i4f2sh75dlh > nixpkgs.json
λ make cabal
(runs cabal2nix
to generate project.nix
)
λ make build
(runs nix-build
)
- wait for a while
λ make test
(run the tests)
λ make run
(test it out!)
Resources
haskell-nix-example's People
Contributors
Stargazers
Watchers