nix/lib/machine/default.nix in confctl-1.0.0 vs nix/lib/machine/default.nix in confctl-2.0.0

- old
+ new

@@ -1,21 +1,21 @@ -{ confDir, corePkgs, coreLib, findConfig }: +{ confDir, corePkgs, coreLib, findMetaConfig }: let swpinsFor = - { name, config }: + { name, metaConfig }: import ../swpins/eval.nix { inherit confDir name; - channels = config.swpins.channels; + channels = metaConfig.swpins.channels; pkgs = corePkgs; lib = coreLib; }; makeModuleArgs = - { config, swpins, spin, name }@args: { + { metaConfig, swpins, spin, name }@args: { swpins = swpins.evaluated; swpinsInfo = swpins.infos; - confMachine = import ./info.nix (args // { inherit findConfig; }); + confMachine = import ./info.nix (args // { inherit findMetaConfig; }); }; makeImports = spin: extraImports: [ ({ config, pkgs, lib, confMachine, ... }: { @@ -32,38 +32,41 @@ networking.domain = lib.mkIf (confMachine.host != null) (lib.mkDefault confMachine.host.fullDomain); }) ] ++ (import ../../modules/module-list.nix).${spin} + ++ (import ../../modules/system-list.nix).${spin} ++ (import "${toString confDir}/modules/module-list.nix").${spin} ++ (import "${toString confDir}/cluster/module-list.nix") ++ extraImports; in rec { - nixos = { name, config }: + nixos = { name, metaConfig }: let - swpins = swpinsFor { inherit name config; }; + swpins = swpinsFor { inherit name metaConfig; }; in { config, pkgs, ... }@args: { _module.args = makeModuleArgs { - inherit config swpins; + metaConfig = config; + inherit swpins; spin = "nixos"; inherit name; }; imports = makeImports "nixos" [ "${toString confDir}/cluster/${name}/config.nix" ]; }; - vpsadminos = { name, config }: + vpsadminos = { name, metaConfig }: let - swpins = swpinsFor { inherit name config; }; + swpins = swpinsFor { inherit name metaConfig; }; in { config, pkgs, ... }@args: { _module.args = makeModuleArgs { - inherit config swpins; + metaConfig = config; + inherit swpins; spin = "vpsadminos"; inherit name; }; imports = makeImports "vpsadminos" [