• Stars
    star
    193
  • Rank 201,081 (Top 4 %)
  • Language
    Nix
  • License
    MIT License
  • Created about 6 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easy PureScript (and other tools) with Nix

Easy PureScript Nix

A project for using PureScript and related tooling easily with Nix. Note that the purescript derivation used in nixpkgs is a derivative of the derivation from this project. See default.nix for more information on available versions.

Example usage

See ci.nix in this repo for a Nix expression example to be used with nix-shell.

$ nix-shell ./ci.nix

Or simply clone this repo, cd into it, and type nix-shell (which implicitly calls shell.nix).

Potential questions

How do I use this? (How do I use derivations in Nix?)

I have written about how to use parts of Nix here: https://github.com/justinwoo/nix-shorts

How do I install to my system from here?

Behold:

$ nix-env -f default.nix -iA purs
  # or nix-env -if purs.nix

$ which purs
/home/justin/.nix-profile/bin/purs
$ purs --version
0.14.4

Or by shell.nix:

{ pkgs ? import <nixpkgs> { } }:
let
  easy-ps = import
    (pkgs.fetchFromGitHub {
      owner = "justinwoo";
      repo = "easy-purescript-nix";
      rev = "5716cd791c999b3246b4fe173276b42c50afdd8d";
      sha256 = "1r9lx4xhr42znmwb2x2pzah920klbjbjcivp2f0pnka7djvd2adq";
    }) {
    inherit pkgs;
  };
in
pkgs.mkShell {
  buildInputs = [
    easy-ps.purs-0_14_4
    easy-ps.psc-package
  ];
}

Nix Flakes

There is a flake.nix. To see what the flake.nix provides,

nix flake show github:justinwoo/easy-purescript-nix

You might need the flag --allow-import-from-derivation if youโ€™re on an older version of Nix.

Deluxe nix develop shell

To get a deluxe PureScript development shell which includes the latest versions of everything,

nix develop github:justinwoo/easy-purescript-nix#deluxe

Custom nix develop shell

Create a custom nix develop shell with a flake.nix like this for example:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
    flake-utils.url = "github:numtide/flake-utils";
    easy-purescript-nix.url = "github:justinwoo/easy-purescript-nix";
  };

  outputs = { nixpkgs, flake-utils, easy-purescript-nix, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
        easy-ps = easy-purescript-nix.packages.${system};
      in
      {
        devShells = {
          default = pkgs.mkShell {
            name = "purescript-custom-shell";
            buildInputs = [
              easy-ps.purs-0_15_8
              easy-ps.spago
              easy-ps.purescript-language-server
              easy-ps.purs-tidy
              pkgs.nodejs-18_x
              pkgs.esbuild
            ];
            shellHook = ''
              source <(spago --bash-completion-script `which spago`)
              source <(node --completion-bash)
              '';
          };
       };
     }
  );
}

Why was this made?

See the blog post about this here: https://github.com/justinwoo/my-blog-posts/blob/master/posts/2018-10-24-using-purescript-easily-with-nix.md

Raison d'etre: https://github.com/justinwoo/my-blog-posts/blob/master/posts/2019-04-29-why-easy-purescript-nix.md

Credits

Thanks to Pekka (@kaitanie) for making this work on NixOS.

More Repositories

1

nix-shorts

A collection of short notes about Nix, down to what is immediately needed for users.
Nix
437
star
2

purescript-simple-json

A simple Purescript JSON library that uses types automatically
PureScript
133
star
3

react-rxjs-flow

a simple react application using RxJS for data flow
JavaScript
103
star
4

react-karma-webpack-testing

Example repository for testing React components using Karma and Webpack. This is likely outdated, it's been 3+ years.
JavaScript
103
star
5

vidtracker

A small, "full-stack" Purescript "video tracker" for me to track what shows I've watched locally
Nix
70
star
6

purescript-ohyes

A library for generating Typescript types that can be used transparently from Purescript.
PureScript
68
star
7

my-blog-posts

my blog posts, about purescript, nix, rust, haskell, etc.
59
star
8

purescript-toppokki

A binding to puppeteer to drive headless Chrome.
PureScript
52
star
9

purescript-milkis

A Purescript library for working with fetch for HTTP requests
PureScript
49
star
10

purescript-resources

This is a repository for a docs site on how to figure things out in PureScript as recommended by me.
Shell
48
star
11

format-nix

A simple formatter for Nix using tree-sitter-nix.
Nix
47
star
12

awesome-rowlist

An attempt to catalog RowList/RowToList/row type content and memes
44
star
13

spago2nix

Generate a derivation of Spago dependencies, and use them to install them into the directory structure used by Spago.
Nix
41
star
14

purescript-record-extra

Extra functions for working with Records
PureScript
30
star
15

purescript-choco-pie

A Cycle.js-like utility for working with Purescript-Event
PureScript
29
star
16

elm-simple-loader

deprecated. this package likely does not work anymore.
JavaScript
26
star
17

redux-rx-fun

redux & rx fun
JavaScript
26
star
18

cycle-scroll-table

a scroll table using cycle.js
TypeScript
26
star
19

easy-dhall-nix

Derivations for easily downloading Dhall binaries and putting them to use.
Nix
25
star
20

spacchetti-react-basic-starter

Fork of react-basic-starter using Package sets
PureScript
24
star
21

real-world-purescript-workshop-2019

Sources for a workshop given at Monadic Party 2019 on PureScript and how to use types and FFI to solve real world problems.
HTML
23
star
22

easy-markdown-beamer-pandoc

Simple things nobody tells you how to do
Nix
22
star
23

react-rxjs-scroll

rough translation of http://www.simple.gy/blog/infinite-bacon/ into react/rxjs code
JavaScript
22
star
24

purescript-web-audio-player-demo

A web audio player demo using Halogen for skipping in different increments
PureScript
21
star
25

purescript-bismuth

A library for generating flow type signatures for direct interop between PureScript and Flow. Similar to OhYes
PureScript
19
star
26

purescript-parcel-example

An example of how PureScript outputs are just CommonJS modules that you can use in any way you want.
PureScript
19
star
27

purescript-0.12.0-hello-world

PureScript 0.12.0 Hello World
PureScript
18
star
28

cycle-elm-etch-sketch

Little demo using Elm from Cycle.js as a driver
JavaScript
18
star
29

elm-scroll-table

this is a very old demo which will not work with newer versions of elm.
HTML
18
star
30

halogen-parcel-hot-reload-demo

An example of one way you could use hot reloading with Halogen.
PureScript
17
star
31

purescript-node-sqlite3

Basic Purescript wrapper for node-sqlite3
PureScript
14
star
32

purescript-bundaegi

because nobody really wants to eat boiled silkworms
PureScript
13
star
33

psc-package2nix

Tool to derive a Nix expression from a psc-package.json configuration.
Haskell
13
star
34

purescript-sunde

Provides a Aff interface to Node Child Process Spawn
PureScript
13
star
35

prefetch-github

A helper to save me some keystrokes from nix-prefetch-git.
Rust
12
star
36

new-purescript-mode

A new, simple purescript mode for cheap syntax highlighting
Emacs Lisp
12
star
37

purescript-lenient-html-parser

A reaaaaaally lenient HTML parser for Purescript inspired by ndmitchell's TagSoup
PureScript
12
star
38

purescript-serialized-actions

just an example of how simple ADTs should have JSON serialization and deserialization automatically derived
PureScript
12
star
39

purescript-home-run-ball

A library for applying a row of rules for validation to refine a value
PureScript
12
star
40

housing-costs-maps

demo showing random housing costs from around the world (through a variety of channels: expedia hotels, same day check-ins, airbnbs, student dormitories). uses cyclejs drivers to drive the charts
JavaScript
12
star
41

call-ps-from-js

this repo demonstrates calling purescript from javascript through the output.
JavaScript
11
star
42

purescript-xstream

A Purescript interface to xstream
PureScript
11
star
43

actually-typing-your-react-redux-program

A guide for those who are stuck not being able to migrate their apps away from JS/TypeScript/Flow. See index.tsx
TypeScript
11
star
44

purescript-cycle-run

A Purescript interface to Cycle.js using xstream
PureScript
10
star
45

weather-telegram-bot

A Telegram Bot example in Purescript using Yahoo's Weather API
PureScript
10
star
46

purescript-cycle-etch-sketch

a purescript-cycle and halogen etch sketch demo
PureScript
10
star
47

purescript-howto-foreign-generic

A tutorial for how to use Purescript's Foreign Generics library
PureScript
10
star
48

godforsaken-dynamic-width-scroll-table

...may no one else ever need this code
JavaScript
10
star
49

purescript-kushiyaki

A library for PureScript 0.12 using Record-Format to parse urls with a template.
PureScript
9
star
50

vt

This is vidtracker but with a Rust backend. PureScript frontend.
PureScript
9
star
51

my-purescript-libraries

A catalog of my PureScript libraries with some notes about what they are, what they do.
Shell
9
star
52

purescript-makkori

A simple PureScript binding to Express made for easy interop.
PureScript
9
star
53

puppeteer-node2nix

A demonstration of how to work with puppeteer using node2nix.
Nix
8
star
54

purescript-kishimen

Sum types with Generics-Rep instances to Variant for free!
PureScript
8
star
55

react-if-else

If/Else rendering components for React
JavaScript
8
star
56

purescript-biang

A library for converting generic reps of Sum and Product to row types, for whatever convenient usage needs at the type level.
PureScript
8
star
57

psc-package-nix

Another Psc-Package Nix tool
Nix
7
star
58

purescript-ochadzuke

A library that combines Simple-JSON, Milkis (Fetch), and Chirashi (Error subtypes).
PureScript
7
star
59

ytcasts

for downloading "YoutubeCasts" with Youtube-dl
PureScript
7
star
60

purp

Some kind of CLI for building PureScript projects with Psc-Package
Haskell
7
star
61

purescript-jajanmen

Cool type-safe Symbol query parameterized helper for Node-SQLite3
PureScript
7
star
62

npm-psc-package-bin-simple

A simple distribution of psc-package using NPM.
JavaScript
7
star
63

soba

packages.dhall to local psc-package set
Rust
7
star
64

purescript-kushikatsu

Simple routing with Kushiyaki.
PureScript
7
star
65

md2sht

a markdown to inline-styled HTML conversion tool, for whichever crappy CMS you use
Haskell
7
star
66

purescript-tanghulu

A library for working with unlimited type-level naturals using an encoding of . in Symbol.
PureScript
7
star
67

react-14-rx-fake-elm-arch

A repository for the demo I posted here: https://gist.github.com/justinwoo/0f4b2a96aebbe3293612
JavaScript
7
star
68

records-fields-pairwise

a pairwise records operation demo with GHC8 generics and generic-lens
Haskell
6
star
69

react-basic-thing

PureScript
6
star
70

simple-rpc-telegram-bot

really terrible telegram chatbot for kicking off my torscraper
JavaScript
6
star
71

gridster-component

reactjs + gridster demo with barely any functionality
JavaScript
6
star
72

ember-cli-api-stub-static

ember-cli add-on for serving out static JSON files as "endpoints" along with the static files served
JavaScript
6
star
73

why-nix-shorts-talk

CSS
5
star
74

purescript-type-isequal

Type equality check returning a Boolean kind. Useful for type-level programming.
PureScript
5
star
75

purescript-node-telegram-bot-api

A subset of the node telegram bot API in Purescript
PureScript
5
star
76

.dotfiles

my dotfiles
Emacs Lisp
5
star
77

empty-repo

sometimes you need one to test some bullshit
5
star
78

purescript-etch-sketch

A Purescript etch-a-sketch written with Pux
PureScript
5
star
79

purescript-bingsu

Cool query building library for Node-SQLite3
PureScript
5
star
80

purescript-redux-devtools

Some bindings to work with Redux DevTools.
PureScript
5
star
81

purescript-gomtang-basic

Another wrapper for ECharts using Union to take records of subsets of allowed fields. Based off of the ideas in React-Basic.
PureScript
5
star
82

purescript-halogen-elm-etch-sketch

an elm etch sketch view embedded in a halogen app
PureScript
5
star
83

react-fixed-scroll-element

Fixed scroll element for React using RxJS
JavaScript
5
star
84

purescript-tortellini

An easy ini library for PureScript
PureScript
5
star
85

purescript-ffi-intro

An introduction to Foreign Function Interface with PureScript, using FFI imports to call JS from PureScript, calling PureScript from JS, and calling JS from PureScript as arguments from JS.
PureScript
5
star
86

purescript-bonjiri

An implementation for working with JS Promises via specifications. For when you want to make use of existing mechanisms in JS libs and debugging tools.
PureScript
5
star
87

purescript-chirashi

An easy way to work with Errors by inserting a Variant, and reading it out later.
PureScript
4
star
88

ffi-imports-bundle

When you have bundled PureScript modules, FFI imports will also be stripped down to what is actually exposed and used.
PureScript
4
star
89

purescript-typelevel-intro

Material for a small introduction including multiple parameter type classes, non-type kinds, and instance chains
PureScript
4
star
90

purescript-kancho

A helper library for constraining types to be Elm port-safe and for providing helpers to codegen Elm types.
PureScript
4
star
91

godawful-purescript-codegen-demo

godawful but almost good purescript code generation with Generics-SOP + Records SOP
Haskell
4
star
92

advent-of-justin-2018

These were the posts for the Advent of Justin 2018 on Qiita
4
star
93

torscraper

the simplest torrent scraper, doesn't handle anything special
JavaScript
4
star
94

elm-simple-ports-example

A simple example for ports in Elm, useful for interop with javascript.
Elm
4
star
95

update-fetch

for updating fetch attributes in nix expressions
Rust
4
star
96

enum-sum-generics-example-simple-json

Example of parsing "enum" style sums using generics with Simple-JSON
PureScript
4
star
97

easy-ormolu-nix

Nix
4
star
98

tracker-hs

a tracking application for some of my files written with the Haskell, Elm, Redis, and Scotty (HERS?) stack?...
Haskell
4
star
99

purescript-calpis

Experimental fork of Milkis using Bonjiri.
PureScript
4
star
100

acme-spago

let's install everything from spacchetti
PureScript
4
star