modules/cluster/deployment: add option extraShares
This commit is contained in:
parent
592d79a9e0
commit
49b6b5dc4d
|
@ -42,6 +42,22 @@
|
|||
Which glusterfs volume to use for persistedShares
|
||||
'';
|
||||
};
|
||||
extraShares = mkOption {
|
||||
type = with types; listOf (submodule {
|
||||
options = {
|
||||
source = mkOption {
|
||||
type = str;
|
||||
};
|
||||
mountPoint = mkOption {
|
||||
type = str;
|
||||
};
|
||||
};
|
||||
});
|
||||
default = [];
|
||||
description = ''
|
||||
Extra shares. THESE MUST BE AVAILABLE ON ALL MICROVM HOSTS!
|
||||
'';
|
||||
};
|
||||
needForSpeed = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
|
|
@ -37,19 +37,30 @@ in
|
|||
rm -f "${writableStoreOverlayImage}"
|
||||
'';
|
||||
|
||||
shares = [ {
|
||||
proto = "virtiofs";
|
||||
tag = "ro-store";
|
||||
source = "/nix/store";
|
||||
mountPoint = "/nix/.ro-store";
|
||||
} ] ++ map (mountPoint: {
|
||||
proto = "virtiofs";
|
||||
tag = builtins.replaceStrings [ "/" ] [ "-" ] (
|
||||
withoutLeadingSlash mountPoint
|
||||
);
|
||||
source = "/glusterfs/${config.deployment.storage}/microvms/${user}/${repo}/${vmName}/${withoutLeadingSlash mountPoint}";
|
||||
inherit mountPoint;
|
||||
}) config.deployment.persistedShares;
|
||||
shares =
|
||||
[ {
|
||||
proto = "virtiofs";
|
||||
tag = "ro-store";
|
||||
source = "/nix/store";
|
||||
mountPoint = "/nix/.ro-store";
|
||||
} ]
|
||||
++
|
||||
map (mountPoint: {
|
||||
proto = "virtiofs";
|
||||
tag = builtins.replaceStrings [ "/" ] [ "-" ] (
|
||||
withoutLeadingSlash mountPoint
|
||||
);
|
||||
source = "/glusterfs/${config.deployment.storage}/microvms/${user}/${repo}/${vmName}/${withoutLeadingSlash mountPoint}";
|
||||
inherit mountPoint;
|
||||
}) config.deployment.persistedShares
|
||||
++
|
||||
map ({ source, mountPoint }: {
|
||||
proto = "virtiofs";
|
||||
tag = builtins.replaceStrings [ "/" ] [ "-" ] (
|
||||
withoutLeadingSlash mountPoint
|
||||
);
|
||||
inherit mountPoint source;
|
||||
}) config.deployment.extraShares;
|
||||
volumes = [ {
|
||||
image = writableStoreOverlayImage;
|
||||
mountPoint = config.microvm.writableStoreOverlay;
|
||||
|
|
Loading…
Reference in New Issue