Initial Commit

This commit is contained in:
Lorenzo Good 2025-01-26 18:49:45 -06:00
commit d07ba813bf
Signed by: lorenzo
GPG key ID: 7FCD64BD81180ED0
14 changed files with 360 additions and 0 deletions

28
nixos/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))