Flake 'git+file:///xxxx' does not provide attribute 'apps.x86_64-linux.default', 'defaultApp.x86_64-linux', 'packages.x86_64-linux.default' or 'defaultPackage.x86_64-linux'

I have my config in a flake and following this page and additional host called hetzner-cloud.

I run nix run . -- root@x.x.x.x --flake '.#hetzner-cloud' which results in this error

error: flake 'git+file:///home/papanito/Workspaces/papanito/nixos-configuration' does not provide attribute 'apps.x86_64-linux.default', 'defaultApp.x86_64-linux', 'packages.x86_64-linux.default' or 'defaultPackage.x86_64-linux'

Going trough all the posts in this forum, which mention the same error, I stull can’t get rid of the error. Here is my flake.nix

  inputs = {
    agenix.url = "github:ryantm/agenix";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    disko.url = "github:nix-community/disko";
  };

  outputs = { self, nixpkgs, disko, ... }@inputs:
    let
      # System types to support.
      supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];

      # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;

      # Nixpkgs instantiated for supported system types.
      nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; });

      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
    in
    {
    packages = forAllSystems (system:
      let pkgs = nixpkgs.legacyPackages.${system};
      in { inherit pkgs; }
    );

    nixosConfigurations = {
      clawfinger = nixpkgs.lib.nixosSystem {
        specialArgs = { inherit inputs; };
        inherit system;
        modules = [
          ./configuration.nix
          ./hosts/clawfinger # Include the results of the hardware scan.
          ./users.nix
          inputs.agenix.nixosModules.default
        ];
      };
      hetzner-cloud = nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ({modulesPath, ... }: {
            imports = [
              ./configuration.nix
              "${modulesPath}/installer/scan/not-detected.nix"
              "${modulesPath}/profiles/qemu-guest.nix"
              disko.nixosModules.disko
            ];
            disko.devices = import ./single-gpt-disk-fullsize-ext4.nix "/dev/sda";
            boot.loader.grub = {
              devices = [ "/dev/sda" ];
              efiSupport = true;
              efiInstallAsRemovable = true;
            };
            services.openssh.enable = true;

            users.users.root.openssh.authorizedKeys.keys = [
              "ssh-rsa XXXXX"
            ];
          })
        ];
      };
    };
  };
}

Can somebody indicate me what I am missing. Please be aware I am very new to nixos and flakes :wink:

You are missing a package.x86_64-linux.default output. Alternatively apps.x86_64-linux.default.

It’s not clear to me though what you want to achieve with that command.

I follow the steps in the example in my question.

And what would the default be? The flake defines 2 hosts, not packages.

nix run doesn’t look for “hosts” it looks for apps and packageif you want to build hosts use nixos-rebuild or nix-darwin cli respectively.