This repository has been archived on 2024-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config/packages/default.nix

26 lines
743 B
Nix
Raw Normal View History

2024-02-23 15:36:14 -06:00
{
self,
nix-fast-build,
...
}:
hostPlatform:
let
2024-02-23 15:54:03 -06:00
inherit (self.pkgs."x86_64-linux") callPackage lib linkFarm;
2024-02-23 15:36:14 -06:00
2024-02-23 15:54:03 -06:00
hostDrvs = lib.mapAttrs (_: nixos: nixos.config.system.build.toplevel) self.nixosConfigurations;
2024-02-23 15:36:14 -06:00
compatHosts = lib.filterAttrs (_: host: host.hostPlatform == hostPlatform) self.hosts;
compatHostDrvs = lib.mapAttrs
(name: _: hostDrvs.${name})
compatHosts;
2024-02-23 15:54:03 -06:00
compatHostsFarm = linkFarm "hosts-x86_64-linux" (lib.mapAttrsToList (name: path: { inherit name path; }) compatHostDrvs);
2024-02-23 15:36:14 -06:00
in
compatHostDrvs
// (lib.optionalAttrs (compatHosts != { }) {
default = compatHostsFarm;
}) // {
2024-02-23 15:54:03 -06:00
inherit (nix-fast-build.packages."x86_64-linux") nix-fast-build;
inherit (self.pkgs."x86_64-linux") cachix nix-eval-jobs;
2024-02-23 15:36:14 -06:00
}