2022-11-25 00:13:47 +03:00
|
|
|
{
|
|
|
|
inputs = {
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils, ... }:
|
|
|
|
let
|
|
|
|
inherit (builtins) listToAttrs mapAttrs;
|
|
|
|
|
2022-12-13 14:18:53 +03:00
|
|
|
mkPackage = pkgs': name:
|
|
|
|
pkgs'.callPackage ./pkgs/${name}.nix (
|
|
|
|
if name == "d2" then { d2plugin-tala = mkPackage pkgs' "d2plugin-tala"; }
|
|
|
|
else { }
|
|
|
|
);
|
2022-11-25 00:13:47 +03:00
|
|
|
mkApp = drv: flake-utils.lib.mkApp { inherit drv; };
|
|
|
|
mkOverlay = name:
|
|
|
|
final: prev:
|
|
|
|
final.setAttrByPath [ name ] (mkPackage name prev);
|
|
|
|
|
2022-12-13 14:18:53 +03:00
|
|
|
allPackageNames = [ "d2" "d2plugin-tala" ];
|
2022-11-25 00:13:47 +03:00
|
|
|
mkAllPackages = pkgs':
|
|
|
|
listToAttrs
|
|
|
|
(map
|
|
|
|
(name: { inherit name; value = mkPackage pkgs' name; })
|
|
|
|
allPackageNames);
|
|
|
|
in
|
|
|
|
{
|
|
|
|
overlays = (listToAttrs
|
|
|
|
(map
|
|
|
|
(name: { inherit name; value = mkOverlay name; })
|
|
|
|
allPackageNames
|
|
|
|
)
|
|
|
|
) // {
|
|
|
|
all = final: prev: mkAllPackages prev;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// flake-utils.lib.eachDefaultSystem (system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
2022-12-13 14:18:53 +03:00
|
|
|
basePackages = mkAllPackages pkgs;
|
|
|
|
packages = with basePackages; {
|
|
|
|
d2full = d2.override { withTala = true; };
|
|
|
|
} // basePackages;
|
2022-11-25 00:13:47 +03:00
|
|
|
in
|
|
|
|
{
|
|
|
|
check = packages;
|
|
|
|
|
|
|
|
inherit packages;
|
|
|
|
apps = mapAttrs (name: mkApp) packages;
|
|
|
|
});
|
|
|
|
}
|