I’m new to Nix and attempting to configure Home Manager via a Flake, however, currently encountering the following error:
error: flake ‘git+file:///Users/danke/dotfiles?dir=nixpkgs%2f.config%2fnixpkgs&shallow=1’ does not provide attribute ‘packages.aarch64-darwin.homeConfigurations.danke.activationPackage’, ‘legacyPackages.aarch64-darwin.homeConfigurations.danke.activationPackage’ or ‘homeConfigurations.danke.activationPackage’
The system on which I’m attempting this configuration is an M1 macbook with MacOS Monterey using Nix version 2.10.3. I was under the impression by executing the following command home-manager would be installed, the flake would be built (using the activationPackage
provided by homeManagerConfiguration
), and the configuration would be ready for activation:
nix build --impure --no-link .#homeConfigurations."$USER".activationPackage
I would appreciate help in understanding and resolving this error. Below is the flake.nix
file used in the configuration. Thanks!
# Flake-based Home Manager: https://nix-community.github.io/home-manager/index.html#ch-nix-flakes
{
description = "Home Manager Configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }: {
homeConfigurations = {
"danke" = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
config = { allowUnfree = true; };
system = "aarch64-darwin";
};
modules = [
./modules/home.nix
{
home = {
username = "danke";
homeDirectory = "/Users/danke";
stateVersion = "22.11";
};
}
];
};
};
};
}