Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home Manager Not Installed #12

Closed
jeff-pow opened this issue Nov 29, 2022 · 2 comments
Closed

Home Manager Not Installed #12

jeff-pow opened this issue Nov 29, 2022 · 2 comments

Comments

@jeff-pow
Copy link

Hello! I'm a recent NixOS explorer attempting to convert a very basic configuration into the minimal flake, but I'm unable to run home manager after rebuilding. Rebuilding from the flake is going just fine, but when I attempt to use the home manager syncing command, it tells me that home manager is not installed. I'll post what I've done that I believe may be pertinent.

path:/home/jeff/nix-flake?lastModified=1669694425&narHash=sha256-Ig67V1wT9ko76L5AU76HDqEmT9wFlFwqv71bCDb4Uc4=
├───homeConfigurations: unknown
└───nixosConfigurations
    └───leggero: NixOS configuration
{
  description = "Your new nix config";

  inputs = {
    # Nixpkgs
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    # Home manager
    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    # TODO: Add any other flake you might need
    hardware.url = "github:nixos/nixos-hardware";

    # Shameless plug: looking for a way to nixify your themes and make
    # everything match nicely? Try nix-colors!
    # nix-colors.url = "github:misterio77/nix-colors";
  };

  outputs = { nixpkgs, home-manager, ... }@inputs: {
    nixosConfigurations = {
      # FIXME replace with your hostname
      leggero = nixpkgs.lib.nixosSystem {
        specialArgs = { inherit inputs; }; # Pass flake inputs to our config
        # > Our main nixos configuration file <
        modules = [ ./nixos/configuration.nix ];
      };
    };

    homeConfigurations = {
      # FIXME replace with your username@hostname
      "jeff@leggero" = home-manager.lib.homeManagerConfiguration {
        pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
        extraSpecialArgs = { inherit inputs; }; # Pass flake inputs to our config
        # > Our main home-manager configuration file <
        modules = [ ./home-manager/home.nix ];
      };
    };
  };
}

And in home.nix

home = {
  username = "jeff";
  homeDirectory = "/home/jeff";
};

I'm likely doing something very basic that I just haven't figured out how to fix yet, but I'd love some help!

@jeff-pow
Copy link
Author

I didn't end up using the correct command. nix build .#homeConfigurations.<username>.activationPackage ended up working

@Misterio77
Copy link
Owner

Misterio77 commented Nov 30, 2022

Hey! Glad it worked for you. home-manager switch --flake .#username should work, however (just nix shell nixpkgs#home-manager if you don't have it available just yet).

ParetoOptimalDev added a commit to ParetoOptimalDev/try-nix-starter-config that referenced this issue Dec 1, 2022
https://github.com/stefan-bordei/nix/blob/30bf0c8c89e5f0c954c768882bfe4a186cc13edd/nixpkgs/flake.nix#L41

So... apparently this is related what the user said about the
home-manager activation package here:

Misterio77/nix-starter-configs#12 (comment)

Maybe `nixos-rebuild vm` is just not supported? But wouldn't that mean
`nixos-rebuild switch --flake` isn't supported?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants