Giter Club home page Giter Club logo

nickel-nix's Introduction

Nickel-nix

An experimental Nix toolkit to use Nickel as a language for writing nix packages, shells and more.

Caution: nickel-nix is not a full-fledged Nix integration. It is currently missing several basic features. nickel-nix is intended to be a proof-of-concept for writing a Nix derivation using Nickel at the moment, without requiring new features either in Nix or in Nickel. The future of the integration of Nix and Nickel will most probably involve deeper changes to the two projects, and hopefully lead to a more featureful and ergonomic solution.

How to use

We currently provide a few basics development environment for some languages. You need Nix with flakes enabled to use Nickel-nix.

You can list available development shell templates by running:

nix flake show github:nickel-lang/nickel-nix

The following example copies the rust devshell and enters the development environment.

$ mkdir my_project
$ cd my_project
$ nix flake init -t github:nickel-lang/nickel-nix#rust-devshell
$ nix develop --impure

Content

This repo is composed of a Nix library, a Nickel library and a flake which provides the main entry point of nickel-nix, the Nix importFromNcl function. This function takes the current directory, a Nickel file and inputs to forward and produces a derivation.

The Nickel library contains in-code documentation that can be leveraged by the nickel query command. For example:

  • nickel query -f nix.ncl will show the top-level documentation and the list of available symbols
  • nickel query -f nix.ncl lib.import_file will show the documentation of a specific symbol, here import_file.

Examples

examples/c-hello-world and its variations build a simple hello world program in C.

The previous example of a shell based on mkShell has been removed. Nickel-nix takes the route of re-implementing a modular devshell framework in pure Nickel, relying solely on Nix for derivation. An example of a such basic development shell is planned in a coming pull request.

More examples of varied derivations are to come.

nickel-nix's People

Contributors

yannham avatar djacu avatar bbigras avatar rapenne-s avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.