From 2c0e68ef9cda9cd0c977e9168c7788fb64ba1cbc Mon Sep 17 00:00:00 2001 From: Florian Schmitt Date: Mon, 30 Sep 2024 16:52:30 +0300 Subject: [PATCH] feat: better vm doc, remove init options --- build-virtual-machine.md | 19 ++++++++++++++----- components/ConfigForm.vue | 3 --- inventory/demo-configuration.nix | 2 -- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/build-virtual-machine.md b/build-virtual-machine.md index 356d5aa..4934dba 100644 --- a/build-virtual-machine.md +++ b/build-virtual-machine.md @@ -1,10 +1,19 @@ -# Build a virtual machine based on your generated configurations +# Build images based on your generated configurations -Your Nix configurations are located in the `inventory` folder you can build and run the configuration file you want by running from the NixiN root folder, for example for the demo configuration file: +Your Nix configurations are located in the `inventory` folder you can build and run the configuration file you want by running nixos-generate from the NixiN root folder. If the build succeeds, the last output is a command located in your nix store to run your vm. + +## Images formats + +Check to find available formats. + +For example, for qemu-kvm runner ```bash -nix-build '' -A vm -I nixpkgs=channel:nixos-24.05 -I nixos-config=./inventory/demo-configuration.nix -./result/bin/run-nixos-vm - +nixos-generate -c inventory/demo-configuration.nix -f vm ``` +(nixos-generate is installed by nix-shell, check `shell.nix` to see the packages added) + +## Cross compile + +Check . diff --git a/components/ConfigForm.vue b/components/ConfigForm.vue index 7580f7e..7e4994e 100644 --- a/components/ConfigForm.vue +++ b/components/ConfigForm.vue @@ -87,9 +87,6 @@ export default { ./hardware-configuration.nix ]; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - networking = { hostName = "{{ networkingHostname }}"; domain = "{{ networkingDomain }}"; diff --git a/inventory/demo-configuration.nix b/inventory/demo-configuration.nix index 79df389..cb2b741 100644 --- a/inventory/demo-configuration.nix +++ b/inventory/demo-configuration.nix @@ -1,7 +1,5 @@ { config, pkgs, ... }: { - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; virtualisation.vmVariant.virtualisation.forwardPorts = [ { from = "host"; host.port = 8001; guest.port = 8001; } ];