forked from mirrors/nixpkgs
88842910b5
Goal is to improve separation between packages and utilities. Can help with autocompletion/navigate nixpkgs faster. Also it will help standardize how LUA_PATH is exported across packages, so that one can more easily make lua changes across nixpkgs (for instance changing where lua modules are installed).
30 lines
682 B
Nix
30 lines
682 B
Nix
# inspired by pkgs/development/haskell-modules/default.nix
|
|
{ pkgs, lib
|
|
, lua
|
|
, overrides ? (final: prev: {})
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (lib) extends;
|
|
|
|
initialPackages = (pkgs.callPackage ../../top-level/lua-packages.nix {
|
|
inherit lua;
|
|
});
|
|
|
|
overridenPackages = import ./overrides.nix { inherit pkgs; };
|
|
|
|
generatedPackages = if (builtins.pathExists ./generated-packages.nix) then
|
|
pkgs.callPackage ./generated-packages.nix { } else (final: prev: {});
|
|
|
|
extensible-self = lib.makeExtensible
|
|
(extends overrides
|
|
(extends overridenPackages
|
|
(extends generatedPackages
|
|
initialPackages
|
|
)
|
|
)
|
|
);
|
|
in
|
|
extensible-self
|