build(xatu): add flake package #78

Closed
alexion wants to merge 8 commits from feat/package-xatu into main
Showing only changes of commit 99f091e92a - Show all commits

View File

@@ -6,13 +6,33 @@
}:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
{
xatu = import ../xatu/package.nix {
inherit
lib
pkgs
root
;
packageDirs =
dir:
lib.flatten (
lib.mapAttrsToList (
name: type:
let
path = dir + "/${name}";
in
if type == "directory" then
packageDirs path
else if type == "regular" && name == "package.nix" then
[ dir ]
else
[ ]
) (builtins.readDir dir)
);
package = dir: {
name = builtins.baseNameOf (toString dir);
value = import (dir + "/package.nix") {
inherit
lib
pkgs
root
;
};
};
}
in
builtins.listToAttrs (map package (packageDirs (root + "/src")))