build(xatu): add flake package #78
@@ -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")))
|
||||
|
||||
Reference in New Issue
Block a user