nix-community / home-manager

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

bug: kanshi breaks nixos-rebuild #5391

Closed jkaye2012 closed 3 weeks ago

jkaye2012 commented 3 weeks ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

I think a recent commit might have inadvertently broken NixOS builds (or I'm doing something incorrect):

error:
       … while calling the 'head' builtin

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:967:11:

          966|         || pred here (elemAt values 1) (head values) then
          967|           head values
             |           ^
          968|         else

       … while evaluating the attribute 'value'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

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

       error: attribute 'attrTag' missing

       at /nix/store/gd2i9ncq2rswcwwai1f5wh0jbz4nl9iz-source/modules/services/kanshi.nix:9:19:

            8|
            9|   directivesTag = types.attrTag {
             |                   ^
           10|     profile = mkOption {

Builds on this machine were functional last night. A build this morning with identical configuration (save for the home-manager version upgrade) fails with the message above. I believe that this change might be the cause.

Maintainer CC

No response

System information

[jkaye@jkaye-nixos:~/git/curated]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.22, NixOS, 24.05 (Uakari), 24.05pre598982.b06025f1533a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos, nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
nurelin commented 3 weeks ago

Yeah, you need to update your nixpkgs. The change uses the new lib.types.attrTag which has been merged in nixpkgs' master branch on April 9.

jkaye2012 commented 3 weeks ago

Thanks - I didn't realize that channels had to be manually updated! Still learning over here. Appreciate the help

blmarket commented 3 weeks ago

Hi, still failing even if I try to update nixpkgs-unstable channel. What command to run in order to update the nixpkgs?

jkaye2012 commented 3 weeks ago

I ran sudo nix-channel --update and my previously failing build started working.

On Sat, May 11, 2024, 6:42 PM Jeong, Heon @.***> wrote:

Hi, still failing even if I try to update nixpkgs-unstable channel. What command to run in order to update the nixpkgs?

— Reply to this email directly, view it on GitHub https://github.com/nix-community/home-manager/issues/5391#issuecomment-2106073191, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7FL7HS7UXSIP3V7ILQPTLZB23GJAVCNFSM6AAAAABHQVJNCGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGA3TGMJZGE . You are receiving this because you modified the open/close state.Message ID: @.***>

blmarket commented 2 weeks ago

With that command, I had to add --upgrade to nixos-rebuild switch to made it work.

sudo nixos-rebuild switch -I {blahblah} -j 4 --upgrade