Commit 15d95c7b authored by K900's avatar K900
Browse files

nixos/qemu-vm: split up the "keep EFI variables from system image" logic

parent 7b602cff
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ let
        NIX_EFI_VARS=$(readlink -f "''${NIX_EFI_VARS:-${config.system.name}-efi-vars.fd}")
        # VM needs writable EFI vars
        if ! test -e "$NIX_EFI_VARS"; then
        ${if cfg.useBootLoader && cfg.useDefaultFilesystems then
        ${if cfg.efi.keepVariables then
            # We still need the EFI var from the make-disk-image derivation
            # because our "switch-to-configuration" process might
            # write into it and we want to keep this data.
@@ -905,6 +905,13 @@ in
            Defaults to OVMF.
          '';
      };

      keepVariables = mkOption {
        type = types.bool;
        default = cfg.useBootLoader;
        defaultText = literalExpression "cfg.useBootLoader";
        description = "Whether to keep EFI variable values from the generated system image";
      };
    };

    virtualisation.tpm = {
+1 −0
Original line number Diff line number Diff line
@@ -513,6 +513,7 @@ let
          virtualisation.useBootLoader = true;
          virtualisation.useEFIBoot = isEfi;
          virtualisation.useDefaultFilesystems = false;
          virtualisation.efi.keepVariables = false;

          virtualisation.fileSystems."/" = {
            device = "/dev/disk/by-label/this-is-not-real-and-will-never-be-used";