Add support for development with Nix

This patch adds support for development with the Nix package manager. In
order to support the traditional nix-shell tool as well as the (still
experimental) Nix Flakes feature of the upcoming version of Nix, this
patch adds shell.nix *and* flake.nix/flake.lock.  Usage instructions
have been added to the README.
Martin Puppe 2 years ago committed by Edward Loveall
parent 56b6d546db
commit 0c018a898a
No known key found for this signature in database
GPG Key ID: A7606DFEC2BA731F

@ -12,12 +12,28 @@ Hopefully a more comprehensive guide will be written at some point, but for now
## Contributing
1. [Install required dependencies](
1. Install required dependencies (see sub-sections below)
1. Run `script/setup`
1. Run `lucky dev` to start the app
1. [Send a patch]( to `~edwardloveall/` (yes that's an email address).
* To be honest, I'm not sure how I feel about the send patch git workflow as opposed to the GitHub style pull request workflow. I'm trying it out for now. If you can't figure it out, get in contact and we can figure out a way to get your contributions in.
### Installing dependencies
General instructions for installing Lucky and its dependencies can be found at <>.
### Installing dependencies with Nix
If you are using the [Nix]( package manager, you can get a shell with all dependencies with the following command(s):
``` shell
# Or if you are using the (still experimental) Nix Flakes feature
nix flake update # Update dependencies (optional)
nix develop
### Learning Lucky
Lucky uses the [Crystal]( programming language. You can learn about Lucky from the [Lucky Guides](

@ -0,0 +1,41 @@
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1631561581,
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
"type": "github"
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
"nixpkgs": {
"locked": {
"lastModified": 1634282420,
"narHash": "sha256-YOI78SSF4Q/ZFoEgfO8Xy3EnjCW/F9VgB2Qz9YljzhI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0a68ef410b40f49de76aecb5c8b5cc5111bac91d",
"type": "github"
"original": {
"id": "nixpkgs",
"type": "indirect"
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"root": "root",
"version": 7

@ -0,0 +1,8 @@
inputs = { flake-utils.url = "github:numtide/flake-utils"; };
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in { devShell = import ./shell.nix { inherit pkgs; }; });

@ -0,0 +1,17 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
shellHook = ''
export PKG_CONFIG_PATH=${}/lib/pkgconfig
buildInputs = with pkgs; [