[run-vm] handle edgecase for prometheus mmaped file on 9p share

This commit is contained in:
2025-01-20 15:43:34 +01:00
parent 155e78b519
commit c71d7959f2

View File

@@ -15,7 +15,7 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
pkgs-unstable = nixpkgs-unstable.legacyPackages."${system}"; pkgs-unstable = nixpkgs-unstable.legacyPackages."${system}";
pkgs = nixpkgs.legacyPackages."${system}"; pkgs = nixpkgs.legacyPackages."${system}";
vmMicroVMOverwrites = options: { vmMicroVMOverwrites = hostname: options: {
microvm = { microvm = {
mem = pkgs.lib.mkForce 4096; mem = pkgs.lib.mkForce 4096;
hypervisor = pkgs.lib.mkForce "qemu"; hypervisor = pkgs.lib.mkForce "qemu";
@@ -43,9 +43,12 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems
fileSystems = { fileSystems = {
"/".fsType = pkgs.lib.mkForce "tmpfs"; "/".fsType = pkgs.lib.mkForce "tmpfs";
"/var/lib" = pkgs.lib.mkIf (options.varPath != "") {
depends = [ "/var" ]; # prometheus uses a memory mapped file which doesnt seem supported by 9p shares
}; # therefore we mount a tmpfs inside the datadir
"/var/lib/prometheus2/data" = pkgs.lib.mkIf (hostname == "overwatch" && options.varPath != "") (pkgs.lib.mkForce {
fsType = pkgs.lib.mkForce "tmpfs";
});
}; };
boot.isContainer = pkgs.lib.mkForce false; boot.isContainer = pkgs.lib.mkForce false;