This repository has no description
764 B
23 lines
1{ ... }:
2{
3 perSystem =
4 { lib, pkgs, ... }:
5 {
6 packages = lib.mapAttrs (
7 name: _:
8 let
9 pkgDir = ./. + "/${name}";
10 hasPackageNix = builtins.pathExists (pkgDir + "/package.nix");
11 hasDefaultNix = builtins.pathExists (pkgDir + "/default.nix");
12 in
13 if hasPackageNix then
14 pkgs.callPackage (pkgDir + "/package.nix") { }
15 else if hasDefaultNix then
16 builtins.trace "Warning: ${name} is using deprecated default.nix, please rename to package.nix" (
17 pkgs.callPackage pkgDir { }
18 )
19 else
20 throw "Package ${name} has neither package.nix nor default.nix"
21 ) (lib.filterAttrs (_n: v: v == "directory") (builtins.readDir ./.));
22 };
23}