1
0
Fork 0
mirror of https://github.com/ciderale/nixos-utm.git synced 2024-12-14 11:37:37 +00:00

include flake default template

This commit is contained in:
Alain Lehmann 2023-10-15 23:11:53 +02:00
parent b287bc500c
commit 5f20067c2a
3 changed files with 23 additions and 2 deletions

View file

@ -12,9 +12,13 @@ automate as much as possible for a simple automation setup.
## How to create a VM
- create a nix flake with a nixosConfiguration defined (e.g. `.#utm`)
- define an environment variable VM_NAME to name the UTM VM (e.g. `myVm`)
- create a nix flake with a nixosConfiguration defined
- the ./example folder provides a flake with minimal example config
- use it with `nix new -t github:ciderale/nixos-utm my-utm-vm`
- define an environment variable VM_NAME to name the UTM VM
- maybe configure this env var within your project/system setup
- kickoff the installation process with the following command
- assuming your flake is the current directory `.` with config `utm`
```
export VM_NAME=myVM

13
example/flake.nix Normal file
View file

@ -0,0 +1,13 @@
{
description = "Description for the project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {flake-parts, ...}: {
nixosConfigurations.utm = import ./default.nix inputs;
};
}

View file

@ -210,6 +210,10 @@
};
flake = {
nixosConfigurations.utm = import ./example/default.nix inputs;
templates.default = {
path = ./example;
description = "A basic UTM VM configuration";
};
};
};
}