45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
|
{
|
||
|
inputs = {
|
||
|
flake-utils.url = "github:numtide/flake-utils";
|
||
|
};
|
||
|
|
||
|
outputs = { self, nixpkgs, flake-utils, ... }:
|
||
|
let
|
||
|
inherit (builtins) listToAttrs mapAttrs;
|
||
|
|
||
|
mkPackage = pkgs: name: pkgs.callPackage ./pkgs/${name}.nix { };
|
||
|
mkApp = drv: flake-utils.lib.mkApp { inherit drv; };
|
||
|
mkOverlay = name:
|
||
|
final: prev:
|
||
|
final.setAttrByPath [ name ] (mkPackage name prev);
|
||
|
|
||
|
allPackageNames = [ "d2" ];
|
||
|
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; };
|
||
|
packages = mkAllPackages pkgs;
|
||
|
in
|
||
|
{
|
||
|
check = packages;
|
||
|
|
||
|
inherit packages;
|
||
|
apps = mapAttrs (name: mkApp) packages;
|
||
|
});
|
||
|
}
|