Add qemu guest agent to all VMs

This commit is contained in:
Torjus Håkestad 2024-12-05 18:35:06 +01:00
parent b06aa943cc
commit 02ef7e861b
Signed by: torjus
SSH Key Fingerprint: SHA256:KjAds8wHfD2mBYK2H815s/+ABcSdcIHUndwHEdSxml4
9 changed files with 66 additions and 28 deletions

6
common/vm/default.nix Normal file
View File

@ -0,0 +1,6 @@
{ ... }:
{
imports = [
./qemu-guest.nix
];
}

4
common/vm/qemu-guest.nix Normal file
View File

@ -0,0 +1,4 @@
{ ... }:
{
services.qemuGuest.enable = true;
}

View File

@ -8,6 +8,7 @@
../template/hardware-configuration.nix
../../system
../../common/vm
];
nixpkgs.config.allowUnfree = true;

View File

@ -1,12 +1,17 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
imports =
[
../template/hardware-configuration.nix
imports = [
../template/hardware-configuration.nix
../../system
];
../../system
../../common/vm
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
@ -39,7 +44,10 @@
};
time.timeZone = "Europe/Oslo";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.settings.tarball-ttl = 0;
environment.systemPackages = with pkgs; [
vim
@ -67,4 +75,3 @@
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -8,6 +8,7 @@
../template/hardware-configuration.nix
../../system
../../common/vm
];
nixpkgs.config.allowUnfree = true;

View File

@ -8,6 +8,7 @@
../template/hardware-configuration.nix
../../system
../../common/vm
];
nixpkgs.config.allowUnfree = true;
@ -52,6 +53,8 @@
git
];
services.qemuGuest.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];

View File

@ -1,14 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
imports =
[
../template/hardware-configuration.nix
imports = [
../template/hardware-configuration.nix
../../system
../../services/ns/master-authorative.nix
../../services/ns/resolver.nix
];
../../system
../../services/ns/master-authorative.nix
../../services/ns/resolver.nix
../../common/vm
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
@ -38,7 +43,10 @@
};
time.timeZone = "Europe/Oslo";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.settings.tarball-ttl = 0;
environment.systemPackages = with pkgs; [
vim
@ -54,4 +62,3 @@
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -1,14 +1,19 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
imports =
[
../template/hardware-configuration.nix
imports = [
../template/hardware-configuration.nix
../../system
../../services/ns/secondary-authorative.nix
../../services/ns/resolver.nix
];
../../system
../../services/ns/secondary-authorative.nix
../../services/ns/resolver.nix
../../common/vm
];
nixpkgs.config.allowUnfree = true;
# Use the systemd-boot EFI boot loader.
@ -38,7 +43,10 @@
};
time.timeZone = "Europe/Oslo";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
environment.systemPackages = with pkgs; [
vim
wget
@ -53,4 +61,3 @@
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -5,6 +5,8 @@
enabledCollectors = [
"systemd"
"logind"
"cgroups"
"processes"
];
};
}