server9, server10: refactor into modules/microvm-host

This commit is contained in:
Astro 2022-08-17 20:57:26 +02:00
parent 56e961221d
commit ac2a9e2246
4 changed files with 19 additions and 15 deletions

View File

@ -694,6 +694,7 @@
modules = [
./hosts/server9
microvm.nixosModules.host
self.nixosModules.microvm-host
self.nixosModules.cluster-network
self.nixosModules.cluster
{ _module.args = { inherit self; }; }
@ -704,6 +705,7 @@
modules = [
./hosts/server10
microvm.nixosModules.host
self.nixosModules.microvm-host
self.nixosModules.cluster-network
self.nixosModules.cluster
{ _module.args = { inherit self; }; }
@ -789,6 +791,7 @@
microvm.nixosModules.microvm
./modules/microvm.nix
];
microvm-host = ./modules/microvm-host.nix;
nncp = ./modules/nncp.nix;
plume = {
imports = [ ./modules/plume.nix ];

View File

@ -4,7 +4,6 @@
imports = [
./hardware-configuration.nix
./microvm-staging.nix
./microvms.nix
];
c3d2 = {
@ -45,5 +44,11 @@
zfs.autoScrub.enable = true;
};
# static list of microvms from other sources
microvm.autostart = [
"data-hoarder"
"staging-data-hoarder"
];
system.stateVersion = "21.11"; # Did you read the comment?
}

View File

@ -31,7 +31,10 @@
services.zfs.autoScrub.enable = true;
services.smartd.enable = true;
c3d2.hq.statistics.enable = true;
c3d2 = {
deployment.microvmBaseZfsDataset = "tank/storage";
hq.statistics.enable = true;
};
# XXX: enable for zw-ev and poelzi-ha until we find a better solution
virtualisation.libvirtd = {

View File

@ -8,21 +8,14 @@
};
config = {
# just all the microvms from this flake
# that are supposed to run on the server
microvm.autostart =
# static list of microvms from other sources
[
"data-hoarder"
"staging-data-hoarder"
]
++
# just all the microvms from this flake
# that are supposed to run on the server
builtins.filter (name:
self.nixosConfigurations.${name}
.config ? c3d2.deployment.server
&& self.nixosConfigurations.${name}
.config.c3d2.deployment.server
== config.networking.hostName
let
inherit (self.nixosConfigurations.${name}) config;
in
(config.c3d2.deployment.server or null) == config.networking.hostName
) (builtins.attrNames self.nixosConfigurations);
systemd.services."microvm-virtiofsd@" = {