diff --git a/potluck/src/packages/default.nix b/potluck/src/packages/default.nix index 62f49df..67f72f8 100644 --- a/potluck/src/packages/default.nix +++ b/potluck/src/packages/default.nix @@ -8,9 +8,32 @@ generic = config.packages.generic; - targeted = { - i686-linux = generic; + getPackages = system: + builtins.mapAttrs + ( + namespace: packages: + lib.attrs.filter + (name: package: builtins.elem system package.meta.platforms) + packages + ); + + targeted' = { + i686-linux = + getPackages "i686-linux" generic + // { + cross = { + x86_64-linux = getPackages "x86_64-linux" generic; + }; + }; }; + + targeted = lib.attrs.generate lib'.systems.doubles.all (system: + getPackages system generic + // { + cross = lib.attrs.generate doubles ( + host: getPackages host generic + ); + }); in { includes = [ # ./aux/foundation.nix @@ -34,16 +57,19 @@ in { generic = { example = { x = { + meta.platforms = ["i686-linux" "x86_64-linux"]; version = "1.0.0"; + builder.build = package: derivation { name = package.name; builder = "/bin/sh"; system = package.platform.build; }; + phases = { - build = '' - make + build = package: '' + make --build ${package.platform.build} --host ${package.platform.host} ''; install = lib.dag.entry.after ["build"] ''