Reorganize imports to prevent infinite recursions
This commit is contained in:
parent
ee6b756d3c
commit
ff0ce9d94c
18 changed files with 136 additions and 89 deletions
|
@ -1,37 +1,28 @@
|
|||
{
|
||||
self,
|
||||
flakeSelf,
|
||||
system,
|
||||
private,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with pkgs.lib;
|
||||
let
|
||||
inherit (self.lib) foldersWithNix;
|
||||
inherit (pkgs.lib)
|
||||
path
|
||||
genAttrs
|
||||
;
|
||||
in
|
||||
{
|
||||
${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));
|
||||
};
|
||||
${system} = genAttrs (foldersWithNix ./.) (
|
||||
name:
|
||||
pkgs.callPackage (path.append ./. "./${name}/default.nix") {
|
||||
inherit
|
||||
self
|
||||
flakeSelf
|
||||
system
|
||||
private
|
||||
;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue