[PATCH 20/22] vm-lib/make-vms.nix: add

Alyssa Ross
2022-10-10T23:32:46Z

This just makes it slightly nicer to have a vms.nix file that defines
multiple Spectrum VMs.

For example,

import <spectrum/make-vms.nix> {} ({ makeVm, pkgs }: {
vm1 = makeVm { /* ... */ };
vm2 = makeVm { /* ... */ };
})

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
vm-lib/make-vms.nix | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 vm-lib/make-vms.nix

diff --git a/vm-lib/make-vms.nix b/vm-lib/make-vms.nix
new file mode 100644
index 0000000..e269cfd
--- /dev/null
+++ b/vm-lib/make-vms.nix
@@ -0,0 +1,19 @@
+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
+
+{ pkgs ? import <nixpkgs> {} }:
+
+let
+ makeVm = import ./make-vm.nix { inherit pkgs; };
+in
+
+pkgs.callPackage (
+{ lib, linkFarm }:
+
+defineVms:
+
+linkFarm "spectrum-vms"
+ (lib.mapAttrsToList (name: path: { inherit name path; })
+ (defineVms { inherit makeVm pkgs; }))
+
+) {}
--
2.37.1