Giter Club home page Giter Club logo

spago2nix-ree's Introduction

spago2nix-ree

Build Status

spago2nix-ree

  • re-uses already built purescript dependencies.
  • so you don't have to re-compile them for every change in your project.

Usage

  • Create spago project

    spago init
    
  • Add a default.nix like:

    { pkgs ? import <nixpkgs> { } }:
    let
      spago2nix-ree = import (builtins.fetchGit {
    
        url = "https://github.com/thought2/spago2nix-ree";
    
        # ... ideally you'd specify a concrete revision here
    
      }) { };
    
      spagoProject = spago2nix-ree.buildProject {
    
        src = ./.;
    
      };
    
    in pkgs.stdenv.mkDerivation {
    
      name = "my-project";
    
      buildCommand = ''
        ln -s ${spagoProject} $out
      '';
    
      buildInputs = [
        # Puts the CLI on the path in a nix shell
        spago2nix-ree.spago2nix-ree
      ];
    }
  • Build it with nix

    nix-shell
    
    spago2nix-ree
    
    # creates spago-lock.json
    
    nix-build
    

You can also use buildProjectDependencies to just build the dependencies instead.

To see the main feature, edit one of your project source files and run nix-build again. Only your local modules get recompiled.

API

v0.1.1

  • buildProject

    { src                           # path
    , spagoLock                     # string
        ? src + "/spago-lock.json"
    }
    # returns: derivation (.spago/*, output/*)
  • buildProjectDependencies

    { src                           # path
    , spagoLock                     # string
        ? src + "/spago-lock.json"
    }
    # returns: derivation (.spago/*, output/*)
  • spago2nix-ree

    # derivation (bin/spago2nix-ree)

Prior Work

  • justinwoo/spago2nix

    Aweseome tool that I used in many projects. However, for my usecase CI builds were not fast enough.

spago2nix-ree's People

Stargazers

Damián Franco Álvarez avatar Andrejs Agejevs avatar Serhii Khoma avatar paluh avatar

Watchers

paluh avatar James Cloos avatar Michael Bock avatar  avatar

Forkers

paluh

spago2nix-ree's Issues

Cleanup

  • Add example in Readme
  • GetConfig (e.g. on --help)
  • remove spago2nix-unpure executable
  • remove 'v0.0.0'
  • purs compile quiet? (no warnings etc..)
  • Add API
  • spago2nix vs spago2nix-ree consistency
  • remove logging 'AAAA'
  • handle sources dynamically
  • Add version + tag
  • Correct example on readme

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.