wip
This commit is contained in:
@@ -17,6 +17,7 @@ in{
|
||||
allPathConfigs = lib.concatMap (app: app.paths) appsList;
|
||||
allSetupConfigs = lib.concatMap (app: if app.setup?script then [({name = app.name; envFile="";} // app.setup)] else []) appsList;
|
||||
allCronsConfigs = lib.concatMap (app: app.cron) appsList;
|
||||
allVMConfigs = builtins.filter (app: app.vm != null) appsList;
|
||||
in{
|
||||
virtualisation.oci-containers = {
|
||||
backend = "podman";
|
||||
@@ -47,7 +48,30 @@ in{
|
||||
'';
|
||||
startAt = "weekly";
|
||||
};
|
||||
} // lib.listToAttrs (lib.concatMap (e: [{
|
||||
}
|
||||
// lib.listToAttrs (lib.concatMap (e: [{
|
||||
name = "${e.name}-vm";
|
||||
value = {
|
||||
description = "Isolated NixOS Guest VM for ${e.name}";
|
||||
after = [ "network-online.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment = {
|
||||
QEMU_VM_REG_SND = "0";
|
||||
NIX_DISK_IMAGE = "/media/data/kvm/${e.name}-guest.qcw2";
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
Restart = "always";
|
||||
RestartSec = "10s";
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p /media/data/kvm";
|
||||
ExecStart = ''
|
||||
${builder.mkVm { name = e.name; vm = e.vm; }}/bin/run-${e.name}-vm -nographic
|
||||
'';
|
||||
};
|
||||
};
|
||||
}]) allVMConfigs)
|
||||
// lib.listToAttrs (lib.concatMap (e: [{
|
||||
name = "${e.name}-setup";
|
||||
value = {
|
||||
description = "Run ${e.name} setup";
|
||||
|
||||
Reference in New Issue
Block a user