diff --git a/templates/simple/dune-project b/templates/simple/dune-project index 37f995d64..0ececa7d7 100644 --- a/templates/simple/dune-project +++ b/templates/simple/dune-project @@ -1 +1 @@ -(lang dune 3.0) +(lang dune 3.8) diff --git a/templates/simple/package.opam b/templates/simple/example.opam similarity index 100% rename from templates/simple/package.opam rename to templates/simple/example.opam diff --git a/templates/simple/flake.nix b/templates/simple/flake.nix index 74422fd4d..fda668340 100644 --- a/templates/simple/flake.nix +++ b/templates/simple/flake.nix @@ -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; [ diff --git a/templates/simple/nix/default.nix b/templates/simple/nix/default.nix index dc9a11b0c..a85d2a0c7 100644 --- a/templates/simple/nix/default.nix +++ b/templates/simple/nix/default.nix @@ -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; }; } diff --git a/templates/simple/src/bin/dune b/templates/simple/src/bin/dune index 995b241cb..808608997 100644 --- a/templates/simple/src/bin/dune +++ b/templates/simple/src/bin/dune @@ -1,4 +1,4 @@ (executable (name main) - (public_name package) - (libraries package)) + (public_name example) + (libraries example)) diff --git a/templates/simple/src/lib/dune b/templates/simple/src/lib/dune index 74423e2eb..33dbb74ad 100644 --- a/templates/simple/src/lib/dune +++ b/templates/simple/src/lib/dune @@ -1,3 +1,3 @@ (library - (name package) - (public_name package)) + (name example) + (public_name example))