server10: set microvm.autostart from all nixosConfigurations
This commit is contained in:
parent
e87daaee2f
commit
137769da25
|
@ -617,6 +617,7 @@
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/server10
|
./hosts/server10
|
||||||
microvm.nixosModules.host
|
microvm.nixosModules.host
|
||||||
|
{ _module.args = { inherit self; }; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ self, config, lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
options = with lib; {
|
options = with lib; {
|
||||||
c3d2.deployment.microvmBaseZfsDataset = mkOption {
|
c3d2.deployment.microvmBaseZfsDataset = mkOption {
|
||||||
|
@ -8,7 +8,19 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
microvm.autostart = [ "oparl" "leon" "nfsroot" "freifunk" ];
|
microvm.autostart =
|
||||||
|
# static list of microvms from other sources
|
||||||
|
[ "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
|
||||||
|
) (builtins.attrNames self.nixosConfigurations);
|
||||||
|
|
||||||
systemd.services."microvm-virtiofsd@" = {
|
systemd.services."microvm-virtiofsd@" = {
|
||||||
requires = [ "microvm-zfs-datasets@%i.service" ];
|
requires = [ "microvm-zfs-datasets@%i.service" ];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user