Skip to content
Snippets Groups Projects
local-grid.nix 1.03 KiB
Newer Older
  • Learn to ignore specific revisions
  • let
      pkgs = import ./nixpkgs-2105.nix {
        config = {};
        overlays = [];
      };
      lib = pkgs.lib;
    in
      let
        grid-file = ./morph/grid/local/grid.nix;
        grid = import grid-file;
        nodes = lib.mapAttrs
          (
            name: node: {
              imports = [ node "${pkgs.morph.lib}/options.nix" ./secrets.nix ./tailscale.nix ];
              _file = grid-file;
              config = {
                networking.hostName = lib.mkDefault name;
                deployment.targetHost = lib.mkDefault name;
                # nixpkgs.pkgs set by pkgs.nixosTest
                # documentation.nixos.extraModuleSources is unneeded
                # TODO: _module.args.nodes
                #   evalConfig { ...,  extraArgs = { nodes = uncheckedNodes ; name = machineName; };
                virtualisation.msize = 1024 * 16;
              };
            }
          ) (builtins.removeAttrs grid [ "network" ]);
        test-pkg = pkgs.nixosTest {
          name = "local-grid";
          testScript = "";
          inherit nodes;
        };
      in
        lib.addMetaAttrs { mainProgram = "nixos-run-vms"; }
          test-pkg.driver