Skip to content

Can't build image from attr #778

Description

@mewoocat

I have confirmed that this is a bug related to nh

  • This is a bug, and not an user error or a support request. I understand that my issue will be closed if it is not a bug in NH.
  • I have checked the issues tab and confirmed that my issue has not yet been reported. I understand that my issue will be closed if it is a duplicate.

Description

I'm using a non flake tack based setup and I'm having a problem with building an iso image for it.

When I run nh os build-image --image-variant iso -f ~/NixOS obsidian, it outputs

             error: attribute 'config' missing
             at «string»:7:22:
                  6| in
                  7|   builtins.attrNames config.config.system.build.images
                   |                      ^
                  8|

where ~/NixOS/default.nix is https://github.com/mewoocat/NixOS/blob/506fe7805186febb2f0a2826f6b81fb166319452/default.nix#L52-L53

Since ~/NixOS/.default.nix's obsidian attribute outputs a eval-config.nix nixos system using ~NixOS/hosts/obsidian/configuration.nix, that should qualify as a valid installer right?

I normally use nh os switch -f ~/NixOS obsidian to rebuild which works fine.

Installation Method

Stable Release (nixpkgs, pkgs.nh from nixos-unstable or nixos-yy-mm)

Installation Method (Other)

No response

NH Version

nh 4.4.2

System Information

system:

  • host os: NixOS-26.05
  • multi-user: no
  • sandbox: no
  • version 26.05
  • nixpkgs: 70cc4559b10a6062b05ff1af17e0add065ccaed9

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug (requires confirmation)User might have misclassified, or might be an AI hallucination. We literally don't know.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions