2021-04-23 18:13:03 -07:00
|
|
|
{ lib }:
|
2019-12-04 22:36:36 -07:00
|
|
|
|
2021-04-23 18:13:03 -07:00
|
|
|
{ self, nixos, inputs, dir, extern, suites, overrides, multiPkgs }:
|
2021-03-20 09:37:03 -07:00
|
|
|
let
|
|
|
|
defaultSystem = "x86_64-linux";
|
2021-02-01 20:26:47 -07:00
|
|
|
|
2021-04-24 08:56:51 -07:00
|
|
|
modules = with lib.modules; {
|
|
|
|
modOverrides = modOverrides { inherit overrides; };
|
|
|
|
hmDefaults = hmDefaults {
|
|
|
|
inherit extern;
|
|
|
|
inherit (self) homeModules;
|
|
|
|
userSuites = suites.user;
|
2021-03-17 15:41:54 -07:00
|
|
|
};
|
2021-04-24 08:56:51 -07:00
|
|
|
globalDefaults = globalDefaults {
|
|
|
|
inherit self nixos inputs multiPkgs;
|
|
|
|
};
|
|
|
|
cachix = cachix { inherit self; };
|
|
|
|
flakeModules = flakeModules { inherit self extern; };
|
2021-03-17 15:41:54 -07:00
|
|
|
};
|
2021-03-14 07:10:51 +00:00
|
|
|
|
2021-03-23 07:36:23 -07:00
|
|
|
specialArgs = extern.specialArgs // { suites = suites.system; };
|
2021-03-14 07:10:51 +00:00
|
|
|
|
|
|
|
mkHostConfig = hostName:
|
|
|
|
let
|
|
|
|
local = {
|
|
|
|
require = [
|
2021-03-20 09:37:03 -07:00
|
|
|
"${dir}/${hostName}.nix"
|
2021-03-14 07:10:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
networking = { inherit hostName; };
|
2021-03-16 19:50:38 +00:00
|
|
|
|
|
|
|
_module.args = {
|
2021-04-23 18:13:03 -07:00
|
|
|
self = self;
|
2021-03-16 14:22:38 -07:00
|
|
|
hosts = builtins.mapAttrs (_: host: host.config)
|
|
|
|
(removeAttrs hosts [ hostName ]);
|
2021-03-16 19:50:38 +00:00
|
|
|
};
|
2021-04-18 23:48:19 -05:00
|
|
|
|
2021-03-17 15:41:54 -07:00
|
|
|
lib = { inherit specialArgs; };
|
|
|
|
lib.testModule = {
|
|
|
|
imports = builtins.attrValues modules;
|
|
|
|
};
|
2021-04-18 23:48:19 -05:00
|
|
|
|
2021-03-17 15:41:54 -07:00
|
|
|
};
|
2021-03-14 07:10:51 +00:00
|
|
|
in
|
2021-04-17 20:35:05 -05:00
|
|
|
lib.os.devosSystem {
|
2021-04-23 18:13:03 -07:00
|
|
|
inherit self nixos inputs specialArgs;
|
2021-03-15 19:04:28 -07:00
|
|
|
system = defaultSystem;
|
2021-04-18 23:48:19 -05:00
|
|
|
modules = modules // { inherit local; };
|
2019-12-13 21:30:43 -07:00
|
|
|
};
|
2019-12-17 16:03:44 -07:00
|
|
|
|
2021-04-17 20:35:05 -05:00
|
|
|
hosts = lib.os.recImport
|
2021-03-14 07:10:51 +00:00
|
|
|
{
|
2021-03-20 09:37:03 -07:00
|
|
|
inherit dir;
|
2021-03-14 07:10:51 +00:00
|
|
|
_import = mkHostConfig;
|
|
|
|
};
|
2020-07-30 22:17:28 -06:00
|
|
|
in
|
|
|
|
hosts
|