nixos-generators icon indicating copy to clipboard operation
nixos-generators copied to clipboard

Location of configuration

Open pasunboneleve opened this issue 1 year ago • 6 comments

I have deployed a VM to GCP. It works fine.

Now I want to change its configuration without redeploying. I just want to use sudo nixos-rebuild switch. But /etc/nixos/configuration.nix just has

{ ... }:
{
  imports = [
    <nixpkgs/nixos/modules/virtualisation/google-compute-image.nix>
  ];
}

Where can I find a copy of the configuration I used within the VM? Is it anywhere there? Can I just place a new configuration anywhere and do the switch?

pasunboneleve avatar Feb 16 '24 05:02 pasunboneleve

The file is being imported from the nixpkgs repository. This is directory where the google-compute-image.nix file lives: https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/virtualisation

You can leave the import statement there, and add (or overwrite) the options you want to change.

liamdiprose avatar Mar 07 '24 19:03 liamdiprose

So that means there's no declarative configuration within the VM? And what I add to /etc/nixos/configuration.nix will be added to the current configuration, rather than clobbering it?

pasunboneleve avatar Mar 08 '24 04:03 pasunboneleve