Initial commit
This commit is contained in:
41
flake.nix
Normal file
41
flake.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
lib = nixpkgs.lib;
|
||||
|
||||
pkgsDir = ./pkgs;
|
||||
|
||||
entries = builtins.readDir pkgsDir;
|
||||
|
||||
# only subdirectories
|
||||
pkgNames =
|
||||
lib.attrNames (lib.filterAttrs (_: t: t == "directory") entries);
|
||||
|
||||
loadPkg = name:
|
||||
let
|
||||
path = pkgsDir + "/${name}";
|
||||
flake = builtins.getFlake (toString path);
|
||||
in
|
||||
# since all are guaranteed identical shape:
|
||||
flake.packages.${system}.default;
|
||||
|
||||
# build final package set
|
||||
packages =
|
||||
lib.listToAttrs (
|
||||
map (name: {
|
||||
inherit name;
|
||||
value = loadPkg name;
|
||||
}) pkgNames
|
||||
);
|
||||
|
||||
in {
|
||||
packages.${system} = packages;
|
||||
|
||||
overlays.default = final: prev: {
|
||||
myPkgs = packages;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user