Skip to content

Instantly share code, notes, and snippets.

@jmackie
Created September 5, 2019 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmackie/d29d51bc967f6d7086c67993a821a39b to your computer and use it in GitHub Desktop.
Save jmackie/d29d51bc967f6d7086c67993a821a39b to your computer and use it in GitHub Desktop.
NixOS revery-ui
let
pkgs = import <nixpkgs> { };
reasonml = import ../reasonml.nix { inherit pkgs; };
libs = p: with p; [ gtk3-x11.dev pango.dev glib.dev cairo.dev gdk-pixbuf.dev atk.dev ];
pkg-config = p: p.stdenv.mkDerivation {
# revery looks for gtk headers via...
# pkg-config --cflags gtk+-x11-3.0
name = "pkg-config-wrapped";
buildInputs = [ p.makeWrapper ] ++ libs p;
buildCommand = ''
mkdir -p $out/bin
makeWrapper ${p.pkg-config}/bin/pkg-config $out/bin/pkg-config \
--set PKG_CONFIG_PATH ${p.lib.makeSearchPath "lib/pkgconfig" (libs p)}
'';
};
fhs = reasonml.esy-env {
targetPkgs = p:
[
p.neovim
(pkg-config p)
p.libpng
p.freetype
p.zlib
p.gtk3-x11
p.harfbuzz
];
};
in pkgs.stdenv.mkDerivation {
name = "esy-env-shell";
buildInputs = [ fhs ];
shellHook = "exec esy-env";
}
{
"name": "revery-quick-start",
"version": "1.3.0",
"description": "Revery quickstart",
"license": "MIT",
"esy": {
"build": "refmterr dune build -p App",
"buildsInSource": "_build"
},
"dependencies": {
"ocaml": "~4.7.0",
"revery": "0.26.0",
"@opam/dune": "1.7.3"
},
"resolutions": {
"@opam/cmdliner": "1.0.2",
"pesy": "0.4.1",
"@brisk/brisk-reconciler": "github:briskml/brisk-reconciler#daa00be",
"rebez": "github:jchavarri/rebez#46cbc183",
"@brisk/brisk-reconciler": "github:briskml/brisk-reconciler#dd933fc",
"@opam/merlin-extend": "0.4",
"esy-glfw": "github:jmackie/esy-glfw#5757e57fff7dc2295325aa94fce577cb861494cd"
},
"scripts": {
"format": "bash -c \"refmt --in-place *.re\"",
"run": "esy x App"
},
"devDependencies": {
"ocaml": "~4.7.0",
"@opam/merlin": "*"
}
}
@BenSchZA
Copy link

BenSchZA commented Nov 4, 2019

Hi @jmackie - I've been trying to get the Revery quickstart project to run on NixOS. I keep getting an error with the fontconfig package, and a few other people seem to too. What is the reasonml.nix file you're referencing here? Keen to give this derivation a try.

@jmackie
Copy link
Author

jmackie commented Nov 4, 2019

Hey man, I've got a working fork of the quickstart somewhere that I'll post when I'm next at my computer. I think this gist was just a note to self at some point so might not actually be useful 🤷‍♂️

@BenSchZA
Copy link

BenSchZA commented Jan 7, 2020

Hey @jmackie :) Just following up on above. Couldn't find that fork on your profile.

@jmackie
Copy link
Author

jmackie commented Jan 7, 2020

Really sorry, totally blanked on this one.

../reasonml.nix is 👉 https://github.com/jmackie/reasonml.nix

I definitely got this working, but I can't honestly remember how "latest" these files are. If it doesn't work for you then let me know and I'll dig out the project I got working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment