Since I don't have time to make a proper project for this, here's how to use it:
cd $YOU_RPROJECT
crystal crystal2nix.cr
ln -s $(nix-build crystal2nix.nix)/lib
module ArrayPlus { | |
fun sample (array : Array(a)) : a { | |
`array[Math.floor(Math.random() * array.length)]` | |
} | |
fun at (index : Number, array : Array(a)) : a { | |
`array[index]` | |
} | |
} |
store Counter.Store { | |
property counter : Number = 0 | |
fun increment : Void { | |
next { state | counter = counter + 1 } | |
} | |
fun decrement : Void { | |
next { state | counter = counter - 1 } | |
} |
module EditorConfig | |
SPEC_VERSION = "0.9.1" | |
# Public: Default config basename. | |
CONFIG_FILENAME = ".editorconfig".freeze | |
# Public: Universal property names. | |
# | |
# https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties | |
INDENT_STYLE = "indent_style".freeze |
record Provider.WebSocket.Subscription { | |
endpoint : Url, | |
message : Function(Html.Event, Void), | |
open : Function(Html.Event, Void), | |
error : Function(Html.Event, Void) | |
} | |
provider Provider.WebSocket : Provider.WebSocket.Subscription { | |
fun attach : Void { | |
` |
source 'https://rubygems.org' do | |
gem 'eventmachine' | |
end |
source 'https://rubygems.org' do | |
gem 'jekyll' | |
end |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"path/filepath" | |
"github.com/watbe/vpk" | |
) |
{ | |
"dependencies": { | |
"greeting": "^1.0.6" | |
}, | |
"name": "y2n", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT" | |
} |
{ config, lib, pkgs, ... }: | |
with lib; | |
let | |
cfg = config.services.syncthing-latest; | |
syncthing-source = pkgs.stdenv.mkDerivation rec { | |
name = "syncthing-source"; | |
version = "0.14.23"; | |
src = pkgs.fetchurl { |