Bug: home-manager seems to be broken on flakes

Issue description

lucasew@acer-nix ~/WORKSPACE/home-manager 1$ nix flake check --show-trace
warning: Git tree '/home/lucasew/WORKSPACE/home-manager' is dirty
warning: flake output attribute 'defaultPackage' is deprecated; use 'packages.<system>.default' instead
error: cannot coerce null to a string

       at /nix/store/2hk95qkrlxwcaphx9ryw6bhqphpaixfq-source/pkgs/stdenv/generic/make-derivation.nix:224:60:

          223|           then attrs.name + hostSuffix
          224|           else "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}";
             |                                                            ^
          225|     }) // {

       … while evaluating the derivation attribute 'name'

       at /nix/store/2hk95qkrlxwcaphx9ryw6bhqphpaixfq-source/pkgs/stdenv/generic/make-derivation.nix:205:7:

          204|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          205|       name =
             |       ^
          206|         let

       … while evaluating the attribute 'depsBuildBuild' of the derivation 'ncurses-6.3'

       at /nix/store/2hk95qkrlxwcaphx9ryw6bhqphpaixfq-source/pkgs/stdenv/generic/make-derivation.nix:205:7:

          204|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          205|       name =
             |       ^
          206|         let

       … while evaluating the attribute 'propagatedBuildInputs' of the derivation 'readline-8.1p0'

       at /nix/store/2hk95qkrlxwcaphx9ryw6bhqphpaixfq-source/pkgs/stdenv/generic/make-derivation.nix:205:7:

          204|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          205|       name =
             |       ^
          206|         let

       … while evaluating the attribute 'buildInputs' of the derivation 'bash-interactive-5.1-p12'

       at /nix/store/2hk95qkrlxwcaphx9ryw6bhqphpaixfq-source/pkgs/stdenv/generic/make-derivation.nix:205:7:

          204|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          205|       name =
             |       ^
          206|         let

       … while evaluating the attribute 'buildCommand' of the derivation 'home-manager'

       at /nix/store/2hk95qkrlxwcaphx9ryw6bhqphpaixfq-source/pkgs/stdenv/generic/make-derivation.nix:205:7:

          204|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          205|       name =
             |       ^
          206|         let

       … while checking the derivation 'defaultPackage.i686-cygwin'

       at /nix/store/2hk95qkrlxwcaphx9ryw6bhqphpaixfq-source/lib/attrsets.nix:215:41:

          214|   */
          215|   nameValuePair = name: value: { inherit name value; };
             |                                         ^
          216|

       … while checking flake output 'defaultPackage'

       at /nix/store/p6nc553wd1jza073xcfdls1lpwnsysv8-source/flake.nix:30:7:

           29|
           30|       defaultPackage =
             |       ^
           31|         forAllSystems (system: self.packages.${system}.home-manager);

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

What’s the point of posting this here, in addition to the issue on GitHub?

I saw some issues being discussed in the past, and someone might contribute to it. If I am wrong, I apologize for that.

Usually that’s people being unsure whether it’s a real bug or if they’re simply not doing something correctly, so they want eyes on it before reporting, or perhaps because the issue is particularly impactful (I can imagine a big security flaw being an announcement for example).

Generally it’s best to keep issue discussion on github, so all of it is nicely in one place, though. Creating additional issues just creates noise, and potentially diverts useful discussion away from where it can be conveniently tracked.

1 Like

Whatever https://github.com/NixOS/nixpkgs/blob/950626ada3fe859186371b251a2bcfa9749b0b5c/pkgs/development/libraries/ncurses/default.nix#L52 is on i686-cygwin has no version attribute and mkDerivation fails.

How did you find it out? is there a PR fixing it?

My thought train:

… while evaluating the attribute 'depsBuildBuild' of the derivation 'ncurses-6.3'

ncurses has only one thing in depsBuildBuild which is stdenv.cc

else "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}";

Is missing version in mkDerivation.

… while checking the derivation 'defaultPackage.i686-cygwin'

and we where in i686-cygwin.

https://github.com/nix-community/home-manager/pull/2839