Restructure to focus on nix.

This commit is contained in:
Lorenzo Good 2025-06-04 01:13:22 -05:00
parent 6952570818
commit 588fdbd9f2
Signed by: lorenzo
GPG key ID: 7FCD64BD81180ED0
19 changed files with 4 additions and 25 deletions

28
lib/packages.nix Normal file
View file

@ -0,0 +1,28 @@
pkgs: let
getPackages = dir: let
entries = builtins.readDir dir;
procEntry = name: type: let
path = dir + "/${name}";
in
if type == "directory"
then
(
if builtins.pathExists (path + "/default.nix")
then [path]
else []
)
else [];
in
builtins.concatLists (
builtins.attrValues (
builtins.mapAttrs procEntry entries
)
);
buildPackage = path: {
name = builtins.baseNameOf (toString path);
value = pkgs.callPackage (path + "/default.nix") {};
};
in
builtins.listToAttrs (builtins.map buildPackage (getPackages ../packages))