home-manager icon indicating copy to clipboard operation
home-manager copied to clipboard

bug: switch complains about a missing attribute `activationPackage`

Open viraptor opened this issue 3 years ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Issue description

I was using home-manager on macos mojave just fine. Since updating to the newest release wiped my /nix, I had to reinstall.

On a completely clean install now (enabled home-manager channel and installed it only), I get:

home-manager switch
error: flake 'path:/Users/viraptor/.config/nixpkgs' does not provide attribute 'packages.x86_64-darwin.homeConfigurations."viraptor".activationPackage', 'legacyPackages.x86_64-darwin.homeConfigurations."viraptor".activationPackage' or 'homeConfigurations."viraptor".activationPackage'

I reduced my flake.nix to this minimal version and it still triggers the issue:

{
  description = "A Home Manager flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = inputs: {
    homeConfigurations = {
      "[email protected]" = inputs.home-manager.lib.homeManagerConfiguration {
        system = "x86_64-darwin";
        homeDirectory = "/Users/viraptor";
        username = "viraptor";
        stateVersion = "21.11";

        configuration = {pkgs, ...}: {
          programs.home-manager.enable = true;
          home.packages = [
            pkgs.btop
          ];
        };
      };
    };
  };
}

Maintainer CC

No response

System information

- system: `"x86_64-darwin"`
 - host os: `Darwin 21.3.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.6.0`
 - channels(viraptor): `"home-manager-21.11.tar.gz"`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

viraptor avatar Feb 01 '22 03:02 viraptor

After some debugging I understand what went wrong - the update changed my hostname, so it didn't match the configured one anymore. It would be great if the error message for that situation was more explicit about what element is actually missing. (i.e. the whole user@host config tree)

viraptor avatar Feb 01 '22 04:02 viraptor

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

  • If this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

stale[bot] avatar May 02 '22 10:05 stale[bot]

A better error would still be nice.

viraptor avatar May 02 '22 10:05 viraptor

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

  • If this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

stale[bot] avatar Aug 03 '22 23:08 stale[bot]

@viraptor how did you find the "hostname" stuff? I get the same error about activationPackage.

YellowOnion avatar Nov 29 '22 10:11 YellowOnion

I ran into this issue too though a bit different because I omitted .lan from my hostname since that's nix-darwin does it.

nix-darwin and home-manager use hostname -s and hostname respectively which can be cofusing on MacOS if you use home-manager standalone instead of the nix-darwin module. You'll end up having homeConfigurations."[email protected]" and darwinConfigurations."host".

https://github.com/LnL7/nix-darwin/blob/6349b99bc2b96ded34d068a88c7c5ced406b7f7f/pkgs/nix-tools/darwin-rebuild.sh#L129

https://github.com/nix-community/home-manager/blob/478610aa37c8339eacabfa03f07dacf5574edd47/home-manager/home-manager#L109

This seems related: https://github.com/nix-community/home-manager/pull/3458

EDIT: I just had the original reported issue. My domain changes from .lan to .local depending on the network I'm connected to.

dacioromero avatar Dec 01 '22 18:12 dacioromero

Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.

If you are the original author of the issue

  • If this is resolved, please consider closing it so that the maintainers know not to focus on this.
  • If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
If you are not the original author of the issue

  • If you are also experiencing this issue, please add details of your situation to help with the debugging process.
  • If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
Memorandum on closing issues

Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.

stale[bot] avatar Mar 02 '23 19:03 stale[bot]