Skip to content

chore: add Nix development environment by flake.nix #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ncaq
Copy link

@ncaq ncaq commented Apr 8, 2025

This PR adds a minimal Nix flake to provide a development environment for building Grapesy.
The flake sets up the necessary native dependencies (snappy, protobuf, zlib) along with Haskell development tools.

Why this approach?

I've chosen to use a simple mkShell rather than more sophisticated Haskell packaging approaches like haskell.nix for several reasons:

The snappy-c Haskell package currently has build issues in nixpkgs master
This configuration focuses solely on providing native dependencies needed for successful builds
The approach keeps compatibility with non-Nix development workflows

The flake provides all necessary tools for development without introducing complex Nix dependencies that might be unfamiliar to many Haskell developers.

What it provides

GHC and cabal-install
Haskell Language Server
Native libraries: snappy, protobuf, zlib
pkg-config for library detection

This should make it easy for Nix users to get started with Grapesy development with a simple nix develop.
I use with direnv.

This PR adds a minimal Nix flake to provide a development environment for building Grapesy.
The flake sets up the necessary native dependencies (snappy, protobuf, zlib) along with Haskell development tools.

Why this approach?
===

I've chosen to use a simple mkShell rather than more sophisticated Haskell packaging approaches like haskell.nix for several reasons:

The snappy-c Haskell package currently has build issues in nixpkgs master
This configuration focuses solely on providing native dependencies needed for successful builds
The approach keeps compatibility with non-Nix development workflows

The flake provides all necessary tools for development without introducing complex Nix dependencies that might be unfamiliar to many Haskell developers.

What it provides
===

GHC and cabal-install
Haskell Language Server
Native libraries: snappy, protobuf, zlib
pkg-config for library detection

This should make it easy for Nix users to get started with Grapesy development with a simple nix develop.
I use with direnv.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant