{
  description = "NixOS OpenStack image build configuration";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-VERSION";
    nixos-generators = {
      url = "github:nix-community/nixos-generators";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, nixos-generators, ... }: {
    packages.x86_64-linux = {
      openstack = nixos-generators.nixosGenerate {
        system = "x86_64-linux";

        modules = [
          # Pin nixpkgs to the flake input, so that the packages installed
          # come from the flake inputs.nixpkgs.url.
          ({ ... }: { nix.registry.nixpkgs.flake = nixpkgs; })

          # This value determines the NixOS release from which the default
          # settings for stateful data, like file locations and database versions
          # on your system were taken. Itâ€˜s perfectly fine and recommended to leave
          # this value at the release version of the first install of this system.
          # Before changing this value read the documentation for this option
          # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
          ({...}: { system.stateVersion = "VERSION"; })
          ./config.nix
        ];

        customFormats = { "my-openstack" = import ./openstack-qcow2-compressed.nix; };
        format = "my-openstack";
      };
    };
  };
}
