Create example configuration for qemu
This commit is contained in:
@@ -150,4 +150,11 @@ in
|
||||
./lucia/hardware_configuration.nix
|
||||
];
|
||||
};
|
||||
|
||||
testvm = nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs.inputs = inputs;
|
||||
specialArgs.self = self;
|
||||
modules = defaultModules ++ [ ./testvm ];
|
||||
};
|
||||
}
|
||||
|
||||
56
machines/testvm/default.nix
Normal file
56
machines/testvm/default.nix
Normal file
@@ -0,0 +1,56 @@
|
||||
{ config, pkgs, inputs, ... }:
|
||||
let
|
||||
sshKeys = import ../ssh_keys.nix;
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
#./hardware-configuration.nix
|
||||
../modules/malobeo_user.nix
|
||||
../modules/sshd.nix
|
||||
../modules/minimal_tools.nix
|
||||
inputs.self.nixosModules.malobeo.initssh
|
||||
inputs.self.nixosModules.malobeo.disko
|
||||
];
|
||||
|
||||
|
||||
malobeo.initssh = {
|
||||
enable = true;
|
||||
authorizedKeys = sshKeys.admins;
|
||||
ethernetDrivers = ["virtio_net"];
|
||||
};
|
||||
|
||||
malobeo.disks = {
|
||||
enable = true;
|
||||
hostId = "83abc8cb";
|
||||
devNodes = "/dev/disk/by-path/";
|
||||
root = {
|
||||
disk0 = "disk/by-path/pci-0000:04:00.0";
|
||||
swap = "1G";
|
||||
reservation = "1G";
|
||||
mirror = false;
|
||||
};
|
||||
storage = {
|
||||
enable = true;
|
||||
disks = ["disk/by-path/pci-0000:08:00.0" "disk/by-path/pci-0000:09:00.0"];
|
||||
reservation = "1G";
|
||||
mirror = true;
|
||||
};
|
||||
};
|
||||
|
||||
boot.initrd.kernelModules = ["virtio_blk" "zfs" "virtio_console" "virtio_pci" "virtio" "virtio_net"];
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
# needed for printing drivers
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
services.acpid.enable = true;
|
||||
|
||||
networking.hostName = "fanny";
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
system.stateVersion = "23.05"; # Do.. Not.. Change..
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user