ryantm / home-manager-template

A quick-start template for using home-manager in a more reproducible way.
https://github.com/ryantm/home-manager-template
Creative Commons Zero v1.0 Universal
113 stars 5 forks source link

Installation fails at Update dependencies with "cannot coerce null to a string" #8

Open L0g4n opened 2 years ago

L0g4n commented 2 years ago

First thanks for the template, I tried to follow the installation instructions, but it fails already in the first step.

error: cannot coerce null to a string

       at /nix/store/cl859pbyw47jzn4jn6ybiwayl0zby8ns-nixpkgs-unstable-src/pkgs/stdenv/generic/make-derivation.nix:192:19:

          191|         // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) {
          192|           name = "${attrs.pname}-${attrs.version}";
             |                   ^
          193|         } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {
(use '--show-trace' to show detailed location information)

Full Trace:

error: cannot coerce null to a string

       at /nix/store/cl859pbyw47jzn4jn6ybiwayl0zby8ns-nixpkgs-unstable-src/pkgs/stdenv/generic/make-derivation.nix:192:19:

          191|         // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) {
          192|           name = "${attrs.pname}-${attrs.version}";
             |                   ^
          193|         } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {

       … while evaluating the derivation attribute 'name'

       at /nix/store/cl859pbyw47jzn4jn6ybiwayl0zby8ns-nixpkgs-unstable-src/pkgs/stdenv/generic/make-derivation.nix:192:11:

          191|         // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) {
          192|           name = "${attrs.pname}-${attrs.version}";
             |           ^
          193|         } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {

       … while evaluating the attribute 'depsBuildBuild' of the derivation 'gmp-6.2.0'

       at /nix/store/cl859pbyw47jzn4jn6ybiwayl0zby8ns-nixpkgs-unstable-src/pkgs/development/libraries/gmp/6.x.nix:14:3:

           13| let self = stdenv.mkDerivation rec {
           14|   name = "gmp-6.2.0";
             |   ^
           15|

       … while evaluating the attribute 'buildInputs' of the derivation 'coreutils-8.31'

       at /nix/store/cl859pbyw47jzn4jn6ybiwayl0zby8ns-nixpkgs-unstable-src/pkgs/stdenv/generic/make-derivation.nix:192:11:

          191|         // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) {
          192|           name = "${attrs.pname}-${attrs.version}";
             |           ^
          193|         } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {

       … while evaluating the attribute 'configurePhase' of the derivation 'QuickCheck-2.13.2'

       at /nix/store/cl859pbyw47jzn4jn6ybiwayl0zby8ns-nixpkgs-unstable-src/pkgs/development/haskell-modules/generic-builder.nix:291:3:

          290| stdenv.mkDerivation ({
          291|   name = "${pname}-${version}";
             |   ^
          292|

       … while evaluating the attribute 'buildInputs' of the derivation 'attoparsec-0.13.2.4'

       at /nix/store/cl859pbyw47jzn4jn6ybiwayl0zby8ns-nixpkgs-unstable-src/pkgs/development/haskell-modules/generic-builder.nix:291:3:

          290| stdenv.mkDerivation ({
          291|   name = "${pname}-${version}";
             |   ^
          292|

       … while evaluating the attribute 'buildInputs' of the derivation 'aeson-1.4.7.1'

       at /nix/store/cl859pbyw47jzn4jn6ybiwayl0zby8ns-nixpkgs-unstable-src/pkgs/development/haskell-modules/generic-builder.nix:291:3:

          290| stdenv.mkDerivation ({
          291|   name = "${pname}-${version}";
             |   ^
          292|

       … while evaluating the attribute 'buildInputs' of the derivation 'niv-0.2.18'

       at /nix/store/cl859pbyw47jzn4jn6ybiwayl0zby8ns-nixpkgs-unstable-src/pkgs/development/haskell-modules/generic-builder.nix:291:3:

          290| stdenv.mkDerivation ({
          291|   name = "${pname}-${version}";
             |   ^
          292|

       … while evaluating the attribute 'buildInputs' of the derivation 'home-manager-shell'

       at /Users/yk/nixfiles/shell.nix:11:3:

           10|
           11|   name = "home-manager-shell";
             |   ^
           12|

Is this error maybe related to not being able to determine the platform (=darwin)? I have Nix 2.4 installed on macOS Big Sur, so I should be good to go.

ryantm commented 2 years ago

It looks like it is having trouble building Niv. What architecture of darwin are you using? x86 or Arm? Looks like this could be related https://github.com/NixOS/nixpkgs/issues/140774

L0g4n commented 2 years ago

Good call, it's indeed ARM. Seems I have to try the workarounds there or just wait for a fix.

L0g4n commented 2 years ago

My home.nix is not minimal, it's the version I used previously with manual installation of home-manager. See here. Only Haskell package I have in there is pandoc which worked just fine at previous times.

sternenseemann commented 2 years ago

It looks like it is having trouble building Niv. What architecture of darwin are you using? x86 or Arm? Looks like this could be related NixOS/nixpkgs#140774

niv fails at build time, this is clearly some sort of eval issue…