Setting options for ProxMox build

I am trying to build an image for ProxMox following instructions here. According this wiki page you can configure proxmox specifc options. I am trying with this configuration.nix:

{
  config,
  lib,
  pkgs,
  ...
}: {
  system.stateVersion = "23.11";
  services.sshd.enable = true;
  services.openssh.settings.PermitRootLogin = lib.mkDefault "yes";
 
  users.users.root.password = "nixos";
  
  proxmox.memory = 4096;
  proxmox.cores = 2;
  proxmox.diskSize = "10G";

}

But if I run nixos-generate -f proxmox -c configuration.nix I get error

The option `proxmox.cores' does not exist.

I do not understand how do I have to specify proxmox specifc options which are among the options of the module, as mentioned in the wiki page.

Did you ever figure this out? I’m struggling with it at the moment as I’m trying to learn it, but it’s currently beyond me.

I want to set the number of cores, memory, efi boot, etc.

Did anyone ever figure this out? I’m using nixos-generator and would like to change the proxmox.qemuConf.bios option to ovmf, but I can’t seem to find where in my repo I should do that.

Of course, as I post a question I find the answer - you can just set it using proxmox.qemuConf.bios = "ovmf"; in your configuration.nix file. I thought it had to defined as a setting in the nixos-generator flake.nix file. New but learning slowly :slight_smile:

I’m stuck at the same problem. Could you post your working configuration.nix here? :sweat_smile:

Took me a while to figure it out. The below config works. You may need to download https://github.com/NixOS/nixpkgs/blob/f592a7ea771bc3c417f7e3026af615d0c6be84ce/nixos/modules/virtualisation/proxmox-image.nix If so import it in the bold line below. Otherwise here is the working config. The key is you have to import proxmox-image.nix and you need to use proxmox.qemuConf and not just proxmox.cores. If you look at the file in the link above, you can see all the variables you can change. Hope this helps someone.

{ config, pkgs, … }:

{

imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
#./proxmox-image.nix # Change it to /path/to/proxmox-image.nix if you need to import
];
proxmox.qemuConf= {
cores = 2;
memory = 2048;
};

the rest of your config file…