maplibre / maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in the browser
https://maplibre.org/maplibre-gl-js/docs/
Other
6.75k stars 727 forks source link

Add a `shell.nix` or prefarably a `flake.nix` #4973

Open Dlurak opened 3 weeks ago

Dlurak commented 3 weeks ago

User Story

As a NixOS user interested in contributing I want to add a flake.nix file to make it easier to start working on this project

Rationale

Impact

This simplifies the initial setup for nix users. It doesn't matter at all to the end user but it does make it easier to start working on this project for nix users.

HarelM commented 3 weeks ago

I'm not familiar enough with this OS, and I think it's too nitch to be added to this project. Having said that, I think the following PR can solve most of what you want:

Currently it is not done correctly and there are a lot of issues there, but they can be solved easily for someone who know docker well. It also can be used for codespaces base image and allow to define what is actually needed in order to develop maplibre.

If this is something that you think can solve your issue it would be great if you could open a PR to add this ability.

Dlurak commented 3 weeks ago

Thank you for your response and for considering ways to support isolated development environments!

I understand that Nix may feel niche compared to Docker. However, a flake.nix could actually complement a Docker-based setup and bring value without affecting non-Nix users:

  1. While Nix is deeply integrated with NixOS it also runs on other Linux distributions and even macOS, making it a versatile chose across a bunch of different enviroments.
  2. A flake.nix file is simpler and more natural for development work than Docker containers. Additionally it's lightweight especially compared to Docker containers.
  3. Adding a flake.nix file would require minimal maintenance and wouldn't interfere with the proposed Docker based setup or the normal not isolated, not reproducible, not declarative setup. Similar to the .editorconfig, it would simply be an optional tool for those who find it useful.

If you're open to it, I'd be happy to submit a PR that introduces a minimal flake.nix file.

HarelM commented 3 weeks ago

If you can create a docker image based on nix to facilitate both use cases, I think it would beneficial. Otherwise, you could probably create a nix for yourself as I don't see us maintaining this file...