diff --git a/machine-manager.nix b/machine-manager.nix index db81003e3b18be35ed6c386a9ae0202f90eeb6e6..2d8e95cbfffbfc516070d90d93a601a1a24ce659 100644 --- a/machine-manager.nix +++ b/machine-manager.nix @@ -32,19 +32,24 @@ let machinesDirContents = readDir machinesDir; machineNames = filter (p: machinesDirContents.${p} == "directory") (attrNames machinesDirContents); withMachines = lambda: listToAttrs (map (m: {name = m; value = lambda { name = m; path = (machinesDir + "/${m}"); }; }) machineNames); - mkMachineConfig = { name, path, isIso }: ( - import ./configuration.nix { - inherit name path isIso extraLayersDir; - channel = machineChannels.${name}; - } - ); evaluateConfig = pkgs: args: (import "${pkgs}/nixos/lib/eval-config.nix" args).config; mkNixosSystemDerivation = { name, path }: let channel = flakeInputs.nixpkgs-unstable; + system = "x86_64-linux"; + mkMachineConfig = { name, path, isIso }: { + imports = [ + (import ./configuration.nix { + inherit name path isIso extraLayersDir; + channel = machineChannels.${name}; + }) + ]; + _module.args.flakeInputs = flakeInputs; + _module.args.flakeOutputs = flakeOutputs; + _module.args.system = system; + }; configuration = mkMachineConfig { inherit name path; isIso = false; }; isoConfiguration = mkMachineConfig { inherit name path; isIso = true; }; - system = "x86_64-linux"; iso = (evaluateConfig channel { inherit system; modules = [