Skip to content

Commit

Permalink
Update template from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrikstrid committed Jul 2, 2023
1 parent 52091c0 commit 3b75f92
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 42 deletions.
2 changes: 1 addition & 1 deletion templates/simple/dune-project
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(lang dune 3.0)
(lang dune 3.8)
File renamed without changes.
8 changes: 4 additions & 4 deletions templates/simple/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
let pkgs = nixpkgs.legacyPackages.${system}; in
{
packages = {
inherit (pkgs.ocamlPackages.callPackage ./nix {
default = pkgs.callPackage ./nix {
inherit nix-filter;
doCheck = true;
}) package;
};
};

devShells = {
default = pkgs.mkShell {
inputsFrom = with self.packages.${system}; [
package
inputsFrom = [
self.packages.${system}.default
];

nativeBuildInputs = with pkgs.ocamlPackages; [
Expand Down
65 changes: 32 additions & 33 deletions templates/simple/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,43 @@
, static ? false
, doCheck
}:
with ocamlPackages; {
package = buildDunePackage {
pname = "package";
version = "1.0.0";
with ocamlPackages;
buildDunePackage {
pname = "example";
version = "1.0.0";

src = with nix-filter.lib;
filter {
# Root of the project relative to this file
root = ./..;
# If no include is passed, it will include all the paths.
include = [
# Include the "src" path relative to the root.
"src"
"test"
# Include this specific path. The path must be under the root.
../package.opam
../dune-project
];
};
src = with nix-filter.lib;
filter {
# Root of the project relative to this file
root = ./..;
# If no include is passed, it will include all the paths.
include = [
# Include the "src" path relative to the root.
"src"
"test"
# Include this specific path. The path must be under the root.
../example.opam
../dune-project
];
};

checkInputs = [
# Put test dependencies here
alcotest
];
checkInputs = [
# Put test dependencies here
alcotest
];

propagatedBuildInputs = [
# Put dependencies here if you're creating a library
];
propagatedBuildInputs = [
# Put dependencies here if you're creating a library
];

buildInputs = [
# Put build-time dependencies here
];
buildInputs = [
# Put build-time dependencies here
];

inherit doCheck;
inherit doCheck;

meta = {
description = "Describe your project here";
# license = stdenv.lib.licenses.bsd3;
};
meta = {
description = "Describe your project here";
# license = stdenv.lib.licenses.bsd3;
};
}
4 changes: 2 additions & 2 deletions templates/simple/src/bin/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(executable
(name main)
(public_name package)
(libraries package))
(public_name example)
(libraries example))
4 changes: 2 additions & 2 deletions templates/simple/src/lib/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(library
(name package)
(public_name package))
(name example)
(public_name example))

0 comments on commit 3b75f92

Please sign in to comment.