I get an error after setting up home-manager as a NixOS module and I think I have set everything right

error code
error: cannot look up '<home-manager/nixos>' in pure evaluation mode (use '--impure' to override)
I have set up home manager as a nix module inside the configuration file and I was following this example:

home-manager.users.ash-17 = { pkgs, ... }: {
  home.packages = [ pkgs.atool pkgs.httpie ];
  home.stateVersion = "23.11";

};

system info.

OS: NixOS 23.11.20230626.6b3d1b1  (Tapir) x86_64
Linux Kernel: 6.1.35
WM: Hyprland
one thing to note is that I use flakes  ^^