Programs.home-manager error:

configuration.nix

{ inputs, ...}: {
  imports = 
  [
    # Сгенерированный файл с дисками/файловыми системами
    ./hardware-configuration.nix

    # Системные модули
    ./modules/default.nix
  ];

  programs.home-manager.enable = true;
  system.stateVersion = "24.11"; # Don't change it bro
}

error

       error: The option `programs.home-manager' does not exist. Definition values:
       - In `/nix/store/...-source/nix/configuration.nix':
           {
             enable = true;
           }

As explained in the other thread, programs.home-manager.enable is a HM option.

So, do I need to write programs.home-manager.enable in home.nix?

Whatever file you feel fit, as long as it is relevant to your homeconfiguration.

1 Like

Let’s say I added the following line to the home.nix file:

programs.home-manager.enable = true;

What should I do next?
Do I need to run the command:

sudo nixos-rebuild switch

or

sudo nixos-rebuild switch --flake

As far as I remember your setup from the other thread, you run home-manager switch --flake …. You might need to get HM into path temporarily first.

1 Like

Thank you for taking the time to help me, I’m really grateful for it.