forked from c3d2/nix-config
server9, server10: refactor into modules/microvm-host
This commit is contained in:
parent
56e961221d
commit
ac2a9e2246
|
@ -694,6 +694,7 @@
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/server9
|
./hosts/server9
|
||||||
microvm.nixosModules.host
|
microvm.nixosModules.host
|
||||||
|
self.nixosModules.microvm-host
|
||||||
self.nixosModules.cluster-network
|
self.nixosModules.cluster-network
|
||||||
self.nixosModules.cluster
|
self.nixosModules.cluster
|
||||||
{ _module.args = { inherit self; }; }
|
{ _module.args = { inherit self; }; }
|
||||||
|
@ -704,6 +705,7 @@
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/server10
|
./hosts/server10
|
||||||
microvm.nixosModules.host
|
microvm.nixosModules.host
|
||||||
|
self.nixosModules.microvm-host
|
||||||
self.nixosModules.cluster-network
|
self.nixosModules.cluster-network
|
||||||
self.nixosModules.cluster
|
self.nixosModules.cluster
|
||||||
{ _module.args = { inherit self; }; }
|
{ _module.args = { inherit self; }; }
|
||||||
|
@ -789,6 +791,7 @@
|
||||||
microvm.nixosModules.microvm
|
microvm.nixosModules.microvm
|
||||||
./modules/microvm.nix
|
./modules/microvm.nix
|
||||||
];
|
];
|
||||||
|
microvm-host = ./modules/microvm-host.nix;
|
||||||
nncp = ./modules/nncp.nix;
|
nncp = ./modules/nncp.nix;
|
||||||
plume = {
|
plume = {
|
||||||
imports = [ ./modules/plume.nix ];
|
imports = [ ./modules/plume.nix ];
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./microvm-staging.nix
|
./microvm-staging.nix
|
||||||
./microvms.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
c3d2 = {
|
c3d2 = {
|
||||||
|
@ -45,5 +44,11 @@
|
||||||
zfs.autoScrub.enable = true;
|
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?
|
system.stateVersion = "21.11"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,10 @@
|
||||||
services.zfs.autoScrub.enable = true;
|
services.zfs.autoScrub.enable = true;
|
||||||
services.smartd.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
|
# XXX: enable for zw-ev and poelzi-ha until we find a better solution
|
||||||
virtualisation.libvirtd = {
|
virtualisation.libvirtd = {
|
||||||
|
|
|
@ -8,21 +8,14 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
# just all the microvms from this flake
|
||||||
|
# that are supposed to run on the server
|
||||||
microvm.autostart =
|
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:
|
builtins.filter (name:
|
||||||
self.nixosConfigurations.${name}
|
let
|
||||||
.config ? c3d2.deployment.server
|
inherit (self.nixosConfigurations.${name}) config;
|
||||||
&& self.nixosConfigurations.${name}
|
in
|
||||||
.config.c3d2.deployment.server
|
(config.c3d2.deployment.server or null) == config.networking.hostName
|
||||||
== config.networking.hostName
|
|
||||||
) (builtins.attrNames self.nixosConfigurations);
|
) (builtins.attrNames self.nixosConfigurations);
|
||||||
|
|
||||||
systemd.services."microvm-virtiofsd@" = {
|
systemd.services."microvm-virtiofsd@" = {
|
Loading…
Reference in New Issue