feat: provisioned resources properly across microvms

This commit is contained in:
Nick 2025-12-04 03:09:51 -06:00
parent 857f2e39a8
commit 30593b866e
11 changed files with 42 additions and 91 deletions

View file

@ -50,9 +50,34 @@ in
systemd = {
services = {
systemd-networkd.wantedBy = [ "multi-user.target" ];
opencloud = {
path = [ pkgs.inotify-tools ];
};
opencloud-fix-permissions = {
description = "Fix OpenCloud storage permissions on file changes";
after = [ "opencloud.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
ExecStart = pkgs.writeShellScript "fix-perms-on-change" ''
${pkgs.inotify-tools}/bin/inotifywait -m -r -e create,moved_to /var/lib/opencloud/storage --format '%w%f' | while read filepath; do
${pkgs.coreutils}/bin/chown opencloud:opencloud "$filepath"
done
'';
Restart = "always";
User = "root";
};
};
};
timers.opencloud-fix-permissions = {
description = "Periodically fix OpenCloud storage permissions";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1min";
OnUnitActiveSec = "1min";
Unit = "opencloud-fix-permissions.service";
};
};
network = {
enable = true;
@ -81,8 +106,6 @@ in
};
systemd.services.systemd-networkd.wantedBy = [ "multi-user.target" ];
microvm = {
vcpu = 1;
mem = 1024 * 1;
@ -142,7 +165,6 @@ in
opencloud
;
};
};
};
};