Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(nix): remove flake-utils #22

Merged
merged 1 commit into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 7 additions & 60 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 57 additions & 42 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,54 +1,69 @@
{
description = "melange-webapi Nix Flake";

inputs.nix-filter.url = "github:numtide/nix-filter";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs = {
url = "github:nix-ocaml/nix-overlays";
inputs.flake-utils.follows = "flake-utils";
};
inputs.nixpkgs.url = "github:nix-ocaml/nix-overlays";

outputs = { self, nixpkgs, flake-utils, nix-filter }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}".appendOverlays [
(self: super: {
ocamlPackages = super.ocaml-ng.ocamlPackages_5_1;
})
];
inherit (pkgs) nodejs_latest lib stdenv darwin;
outputs = { self, nixpkgs }:
let
forAllSystems = f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system:
let
pkgs = nixpkgs.legacyPackages.${system}.extend (self: super: {
ocamlPackages = super.ocaml-ng.ocamlPackages_5_2;
});
in
f pkgs);
in
{
packages = forAllSystems (pkgs:
let
melange-webapi = with pkgs.ocamlPackages; buildDunePackage {
pname = "melange-webapi";
version = "dev";

melange-webapi = with pkgs.ocamlPackages; buildDunePackage {
pname = "melange-webapi";
version = "dev";
src =
let fs = pkgs.lib.fileset; in
fs.toSource {
root = ./.;
fileset = fs.unions [
./dune-project
./melange-webapi.opam
./src
./tests
];
};

src = ./.;
nativeBuildInputs = with pkgs.ocamlPackages; [ melange reason ];
propagatedBuildInputs = with pkgs.ocamlPackages; [
melange
melange-fetch
];
};
nativeBuildInputs = with pkgs.ocamlPackages; [ melange reason ];
propagatedBuildInputs = with pkgs.ocamlPackages; [
melange
melange-fetch
];
};
in
{
inherit melange-webapi;
default = melange-webapi;
});

devShells = forAllSystems (pkgs:
let
mkShell = { buildInputs ? [ ] }: pkgs.mkShell {
inputsFrom = [ self.packages.${pkgs.system}.melange-webapi ];
nativeBuildInputs = with pkgs; [
yarn
nodejs_latest
] ++ (with pkgs.ocamlPackages; [
ocamlformat
merlin
]);
inherit buildInputs;
};

mkShell = { buildInputs ? [ ] }: pkgs.mkShell {
inputsFrom = [ melange-webapi ];
nativeBuildInputs = with pkgs; [
yarn
nodejs_latest
] ++ (with pkgs.ocamlPackages; [
ocamlformat
merlin
]);
inherit buildInputs;
};
in
rec {
packages.default = melange-webapi;
devShells = {
in
{
default = mkShell { };
release = mkShell {
buildInputs = with pkgs; [ cacert curl ocamlPackages.dune-release git ];
};
};
});
});
};
}