infrastructure/packages/default.nix
Fabian Hauser 15ece3585e
All checks were successful
CI / build (push) Successful in 2m46s
Migrate packages to use callPackage pattern
2024-10-19 20:00:52 +03:00

37 lines
753 B
Nix

{
self,
system,
pkgs,
...
}:
with pkgs.lib;
{
${system} =
let
packages = pipe (self.lib.foldersWithNix ./.) [
(map (name: {
inherit name;
path = path.append ./. "./${name}/default.nix";
}))
(map (
{ name, path }:
{
inherit name;
value = pkgs.callPackage path {
inherit self;
inherit system;
};
}
))
listToAttrs
];
in
packages
// {
default =
let
nixosConfigs = mapAttrsToList (n: v: v.config.system.build.toplevel) self.nixosConfigurations;
in
pkgs.linkFarmFromDrvs "all" (nixosConfigs ++ (attrValues packages));
};
}