nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.15k stars 1.85k forks source link

bug: attrTag missing #6061

Closed zodman closed 2 weeks ago

zodman commented 2 weeks ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

I run the install command:

nix-shell '<home-manager>' -A install

and I get:

The file /home/avargas/.config/home-manager/home.nix already exists, leaving it unchanged...

Creating initial Home Manager generation...

error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/3bi1ssj310l4jj3i6abqgiafyc7fx0nd-nixpkgs/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'
         at /nix/store/3bi1ssj310l4jj3i6abqgiafyc7fx0nd-nixpkgs/nixpkgs/pkgs/build-support/trivial-builders/default.nix:87:15:
           86|       enableParallelBuilding = true;
           87|       inherit buildCommand name;
             |               ^
           88|       passAsFile = [ "buildCommand" ]

       … while evaluating the option `home.activation.installPackages.data':

       … while evaluating definitions from `/nix/store/bw00afh3z6d4dklw47vkbsgf0nxkxlzk-home-manager-24.05.tar.gz/home-manager/modules/home-environment.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'attrTag' missing
       at /nix/store/bw00afh3z6d4dklw47vkbsgf0nxkxlzk-home-manager-24.05.tar.gz/home-manager/modules/services/kanshi.nix:9:19:
            8|
            9|   directivesTag = types.attrTag {
             |                   ^
           10|     profile = mkOption {
Uh oh, the installation failed! Please create an issue at

    https://github.com/nix-community/home-manager/issues

if the error seems to be the fault of Home Manager.
[ble: exit 1]

Maintainer CC

No response

System information

- system: `"x86_64-linux"`
 - host os: `Linux 6.8.0-48-generic, Ubuntu, 24.04.1 LTS (Noble Numbat), nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.10`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
zodman commented 2 weeks ago

I had the incorrect version channel:

$ nix-channel  --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
unstable https://nixos.org/channels/nixpkgs-unstable
$  nix-instantiate --eval -E '(import <nixpkgs> {}).lib.nixpkgsVersion'
trace: `lib.nixpkgsVersion` is deprecated, use `lib.version` instead!
"24.05pre564573.d44d59d2b5bd"

$ nix-instantiate --eval -E '(import {}).lib.nixpkgsVersion' evaluation warning: lib.nixpkgsVersion is a deprecated alias of lib.version. "24.11pre704822.85f7e662eda4"

like newbie I didn't understand the channels should be named nixpkgs for being unstable:

$ nix-channel  --remove unstable
$ nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs
$ nix-channel --update 
$ nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
$ nix-shell '<home-manager>' -A install

now works