cachix / Elm2nix
Licence: other
Convert Elm project into Nix expressions
Stars: ✭ 65
Labels
Projects that are alternatives of or similar to Elm2nix
Nixery
Container registry which transparently builds images using the Nix package manager
Stars: ✭ 1,023 (+1473.85%)
Mutual labels: nix
Neutron
🌠 Purely functional Apache Pulsar client for Scala built on top of Fs2
Stars: ✭ 53 (-18.46%)
Mutual labels: nix
Hs Nix Template
A Haskell project template that can be built with nix and developed by ghcid and cabal-install.
Stars: ✭ 57 (-12.31%)
Mutual labels: nix
Rust Overlay
Pure and reproducible nix overlay for binary distributed rust toolchains
Stars: ✭ 46 (-29.23%)
Mutual labels: nix
Setup.nix
Nixpkgs based build tools for declarative Python packages [[email protected]]
Stars: ✭ 62 (-4.62%)
Mutual labels: nix
Nix Hs Hello Windows
Cross compiling Hello World (haskell) to Windows using nix.
Stars: ✭ 55 (-15.38%)
Mutual labels: nix
Rien
Predictable Haskell development environments with Cabal and Nix.
Stars: ✭ 65 (+0%)
Mutual labels: nix
Homelab
Configuration management for Matt Layher's machines. MIT Licensed.
Stars: ✭ 57 (-12.31%)
Mutual labels: nix
elm2nix
Convert an Elm project into Nix expressions.
It consists of multiple commands:
-
elm2nix convert
: Givenelm.json
in current directory, all dependencies are parsed and their sha256sum calculated -
elm2nix snapshot
: Downloads snapshot of http://package.elm-lang.org intoversions.dat
-
elm2nix init
: Generatesdefault.nix
that glues everything together
Assumptions
Supports Elm 0.19.1
Installation
From nixpkgs (recommended)
Make sure you have up to date stable or unstable nixpkgs channel.
$ nix-env -i elm2nix
From source
$ git clone https://github.com/domenkozar/elm2nix.git
$ cd elm2nix
$ nix-env -if .
Usage
$ git clone https://github.com/evancz/elm-todomvc.git
$ cd elm-todomvc
$ elm2nix init > default.nix
$ elm2nix convert > elm-srcs.nix
$ elm2nix snapshot > versions.dat
$ nix-build
$ chromium ./result/Main.html
Running tests (as per CI)
$ ./scripts/tests.sh
FAQ
default.nix
?
Why is mkDerivation inlined into As it's considered experimental, it's generated for now. Might change in the future.
How to use with ParcelJS and Yarn?
Instead of running elm2nix init
, use something like:
{ pkgs ? import <nixpkgs> {}
}:
let
yarnPkg = pkgs.yarn2nix.mkYarnPackage {
name = "myproject-node-packages";
packageJSON = ./package.json;
unpackPhase = ":";
src = null;
yarnLock = ./yarn.lock;
publishBinsFor = ["parcel-bundler"];
};
in pkgs.stdenv.mkDerivation {
name = "myproject-frontend";
src = pkgs.lib.cleanSource ./.;
buildInputs = with pkgs.elmPackages; [
elm
elm-format
yarnPkg
pkgs.yarn
];
patchPhase = ''
rm -rf elm-stuff
ln -sf ${yarnPkg}/node_modules .
'';
shellHook = ''
ln -fs ${yarnPkg}/node_modules .
'';
configurePhase = pkgs.elmPackages.fetchElmDeps {
elmPackages = import ./elm-srcs.nix;
versionsDat = ./versions.dat;
};
installPhase = ''
mkdir -p $out
parcel build -d $out index.html
'';
}
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].