-
Notifications
You must be signed in to change notification settings - Fork 0
/
tutorial.txt
34 lines (22 loc) · 1.1 KB
/
tutorial.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Create a nix file to your liking, include the base.nix from this repo as it is what enables the hostname generation.
Use nixos-generator to generate the qcow2 file:
nixos-generate -f qcow -c ./your-config.nix
Copy the generated qcow2 ( nixos.qcow2 ) from the nixos store to any R/W directory and rename the image respectively, ie nixos-24-11.qcow2, or pc.qcow2, server.qcow2, etc.
Use the GNS3 appliance for NixOS: https://gns3.com/marketplace/appliances/nixos
or create your own as any other qemu appliance but pass the vm name in advanced options:
-fw_cfg name=opt/vm_hostname,string=%vm-name%
base.nix
Contains logic for setting hostname. Must be imported into another file such as pc.nix, server.nix, etc.
pc.nix
bare bone image with cmd line tools
server.nix
Runs an nginx web server
dns-server.nix
runs a name server for labs
desktop.nix
Has web browser and terminal
Auto logs to xmonad xfce session
Browser is started on workspace 1
Terminal is started on workspace 2
To switch workspaces use ALT + 1, ALT + 2, etc.
Good for checking things like web servers or anything that supports web browser access.