build(xatu): add flake package #78

Closed
alexion wants to merge 8 commits from refs/pull/78/head into main
pull from: refs/pull/78/head
Showing only changes of commit 99f091e92a - Show all commits
+23 -3
View File
@@ -6,13 +6,33 @@
}: }:
let let
pkgs = inputs.nixpkgs.legacyPackages.${system}; pkgs = inputs.nixpkgs.legacyPackages.${system};
packageDirs =
dir:
lib.flatten (
lib.mapAttrsToList (
name: type:
let
path = dir + "/${name}";
in in
{ if type == "directory" then
xatu = import ../xatu/package.nix { 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 inherit
lib lib
pkgs pkgs
root root
; ;
}; };
} };
in
builtins.listToAttrs (map package (packageDirs (root + "/src")))