Skip to content

Commit

Permalink
Updates flake.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
solomon-b committed Jul 9, 2023
1 parent b0fd023 commit 7378b20
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
12 changes: 6 additions & 6 deletions flake.lock

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

24 changes: 21 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,42 @@
let
pkgs = nixpkgs.legacyPackages.${system};
on = opam-nix.lib.${system};

localPackagesQuery = builtins.mapAttrs (_: pkgs.lib.last)
(on.listRepo (on.makeOpamRepo ./.));

devPackagesQuery = {
ocaml-lsp-server = "*";
ocp-indent = "*";
merlin = "*";
};

query = devPackagesQuery // {
ocaml-base-compiler = "*";
};

scope = on.buildDuneProject { } "polytt" ./. query;

overlay = self: super: {
# Prevent unnecessary dependencies on the resulting derivation
polytt = super.polytt.overrideAttrs (_: {
removeOcamlReferences = true;
postFixup = "rm -rf $out/nix-support";
});
};

scope' = scope.overrideScope' overlay;

# Packages from devPackagesQuery
devPackages = builtins.attrValues
(pkgs.lib.getAttrs (builtins.attrNames devPackagesQuery) scope);
(pkgs.lib.getAttrs (builtins.attrNames devPackagesQuery) scope');

# Packages in this workspace
packages =
pkgs.lib.getAttrs (builtins.attrNames localPackagesQuery) scope;
pkgs.lib.getAttrs (builtins.attrNames localPackagesQuery) scope';
in
{
legacyPackages = scope;
legacyPackages = scope';

packages = packages // { default = packages.polytt; };

Expand Down

0 comments on commit 7378b20

Please sign in to comment.