Creating Proxmox LXC template

Following these instructions:

$ nix run github:nix-community/nixos-generators – --format proxmox-lxc
error: experimental Nix feature ‘nix-command’ is disabled; add ‘–extra-experimental-features nix-command’ to enable it

I tried adding --extra-experimental-features in just about every position but nothing worked. What to do?

Do you have nix-command enabled in your config?

nix.settings.experimental-features = [ "nix-command" "flakes" ];

Have you just added --extra-experimental-features or have you also added nix-command? e.g. nix run --extra-experimental-features nix-command github:nix-community/nixos-generators –- --format proxmox-lxc

That flag lets you specify experimental features to temporarily enable, it doesn’t add any by itself.

Thanks but neither of those helped. I added

nix.settings.experimental-features = [ “nix-command” ];

to /etc/nixos/configuration.nix and then nixos-rebuild switch but:

[mounty@ida:~]$ nix run github:nix-community/nixos-generators – --format proxmox-lxc
error: unrecognised flag ‘–format’
Try ‘nix --help’ for more information.
[mounty@ida:~]$ nix run --extra-experimental-features nix-command github:nix-community/nixos-generators –- --format proxmox-lxc
error: unrecognised flag ‘–format’
Try ‘nix --help’ for more information.

You have in your first command – instead of -- and in your second command –- instead of --
copy the right command from the wiki

nix run github:nix-community/nixos-generators -- --format proxmox-lxc

Thank you Gamebeaker and GraysonTinker.