modules/cluster: prepare for leon

This commit is contained in:
Astro 2022-11-21 04:00:54 +01:00
parent ecbb8818bb
commit 4b6fce111a
2 changed files with 19 additions and 6 deletions

View File

@ -49,6 +49,12 @@ in {
uid = 1001;
sshKeys = config.users.users.root.openssh.authorizedKeys.keys;
};
users.leon = {
uid = 1002;
sshKeys = with import ../../users.nix;
leon.sshKeys ++
astro.sshKeys;
};
deploy.customizationModule = ./deployment.nix;
storage.glusterfs = {

View File

@ -33,6 +33,8 @@ let
then s
else withoutLeadingSlash s';
writableStoreOverlayImage = "/var/tmp/${user}-${repo}-${vmName}-overlay.img";
in
{
deployment.networks = nets;
@ -42,6 +44,11 @@ in
vcpu = config.deployment.vcpu;
mem = config.deployment.mem;
preStart = ''
# Discard old writable store overlay
rm -f "${writableStoreOverlayImage}"
'';
shares = [ {
proto = "virtiofs";
tag = "ro-store";
@ -55,12 +62,12 @@ in
source = "/glusterfs/fast/microvms/${user}/${repo}/${vmName}/${withoutLeadingSlash mountPoint}";
inherit mountPoint;
}) config.deployment.persistedShares;
# volumes = [ {
# image = "/glusterfs/fast/microvms/${user}/${repo}/${vmName}/overlay.img";
# mountPoint = "/";
# size = 8 * 1024;
# } ];
# writableStoreOverlay = "/nix/.rw-store";
volumes = [ {
image = writableStoreOverlayImage;
mountPoint = config.microvm.writableStoreOverlay;
size = 8 * 1024;
} ];
writableStoreOverlay = "/nix/.rw-store";
interfaces = map (net: {
type = "tap";