Skip to content

Commit

Permalink
[WIP] Add nix shell.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoo1 committed Aug 16, 2021
1 parent a4a3612 commit f87f445
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_build
*.install
*.merlin
*.merlin
/result
11 changes: 11 additions & 0 deletions pin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
let
# 2021-08-15
nix-rev = "3ab8ce12c2db31268f579c11727d9c63cfee2eee";
nix-src = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${nix-rev}.tar.gz";
sha256 = "13fx0yb95gxyk0jyvgrxv2yp4fj54g7nzrlvjfc8slx9ccqd2v86";
};
in import nix-src {
overlays =
[ (_: super: { ocamlPackages = super.ocaml-ng.ocamlPackages_4_08; }) ];
}
111 changes: 111 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
let
pkgs = import ./pin.nix;
ocaml-xkbcommon = pkgs.ocamlPackages.buildDunePackage {
pname = "xkbcommon";
version = "0.1";
useDune2 = true;
src = pkgs.fetchFromGitHub {
owner = "Armael";
repo = "ocaml-xkbcommon";
rev = "af0cd8c938938db3e67b65ac13b6444102756ba0";
sha256 = "0zh80aczdn821xkwjn8m74mjcqb6f1hj0qfh1kxrz2z9h5as2r8k";
};
buildInputs = [
pkgs.libxkbcommon
pkgs.ocamlPackages.dune-configurator
pkgs.libxkbcommon
];
propagatedBuildInputs = [
pkgs.ocamlPackages.ctypes
pkgs.ocamlPackages.base
pkgs.ocamlPackages.stdio
];
meta = {
homepage = "https://github.com/Armael/ocaml-xkbcommon";
synopsis = "OCaml bindings to xkbcommon";
description = "This package provides OCaml bindings to xkbcommon";
maintainers = [ ];
};
};
ocaml-unix-errno = pkgs.ocamlPackages.buildOcaml rec {
name = "unix-errno";
version = "0.5.2";
src = pkgs.fetchFromGitHub {
owner = "dsheets";
repo = "ocaml-unix-errno";
rev = version;
sha256 = "1k1pcr9v7hb8jqbbhz1k8c0rs5lzmbgkslb3gv4b53r6sajxrpbf";
};
nativeBuildInputs = [ pkgs.ocamlPackages.alcotest ];
propagatedBuildInputs = [
pkgs.ocamlPackages.ctypes
pkgs.ocamlPackages.ocaml
pkgs.ocamlPackages.result
];
meta = {
homepage = "https://github.com/dsheets/ocaml-unix-time";
synopsis = "Unix time.h types, maps, and support";
description = ''
unix-time provides access to the features exposed in time.h in a way
that is not tied to the implementation on the host system.
The Time module provides types which are analogous to those defined in
time.h such as timespec.
The Time_unix module provides a ctypes view for timespec.
'';
maintainers = [ ];
};
};
ocaml-unix-time = pkgs.ocamlPackages.buildOcaml rec {
name = "unix-time";
version = "0.1.0";
src = pkgs.fetchFromGitHub {
owner = "dsheets";
repo = "ocaml-unix-time";
rev = version;
sha256 = "1ib5khdjdx4zk2hgr9dcxwbfpc6wl31mw760gd4dvmjvgdzrrv94";
};
doCheck = true;
nativeBuildInputs =
[ pkgs.ocamlPackages.alcotest pkgs.ocamlPackages.ctypes ];
propagatedBuildInputs = [ pkgs.ocamlPackages.ocaml ocaml-unix-errno ];
meta = {
homepage = "https://github.com/dsheets/ocaml-unix-time";
synopsis = "Unix time.h types, maps, and support";
description = ''
unix-time provides access to the features exposed in time.h in a way
that is not tied to the implementation on the host system.
The Time module provides types which are analogous to those defined in
time.h such as timespec.
The Time_unix module provides a ctypes view for timespec.
'';
maintainers = [ ];
};
};

in pkgs.mkShell {
name = "wlroots-ocaml-shell";
propagatedBuildInputs = [
pkgs.ocamlPackages.ctypes
pkgs.ocamlPackages.dune-configurator
pkgs.ocamlPackages.mtime
ocaml-unix-time
# ocaml-xkbcommon
];
nativeBuildInputs = [
pkgs.dune_2
pkgs.ocamlPackages.findlib
# Should be put upstream as an input for wlroots
pkgs.libudev
pkgs.m4
pkgs.ocaml
pkgs.pixman
pkgs.pkg-config
pkgs.less
pkgs.wayland
pkgs.wayland-protocols
pkgs.wlroots
];
shellHook = ''
export NIX_PATH=nixpkgs=${pkgs.path}
'';
}

0 comments on commit f87f445

Please sign in to comment.