Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure: error: value is null while a Boolean was expected #234948

Closed
hoidOS opened this issue May 30, 2023 · 18 comments
Closed

Build failure: error: value is null while a Boolean was expected #234948

hoidOS opened this issue May 30, 2023 · 18 comments

Comments

@hoidOS
Copy link

hoidOS commented May 30, 2023

Steps To Reproduce

Steps to reproduce the behavior:

  1. … while evaluating the attribute 'buildCommand' of the derivation 'home-manager-generation'
  2. Error happens on the nixos-unstable channel
  3. Pinned the nixpkgs to commit 6b554aa and the error is gone.

Build log

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

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/make-derivation.nix:303:7:

          302|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          303|       name =
             |       ^
          304|         let

       … while evaluating the attribute 'text' of the derivation 'activation-script'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/make-derivation.nix:303:7:

          302|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          303|       name =
             |       ^
          304|         let

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'mkCmd'

       at /nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/home-environment.nix:659:17:

          658|       let
          659|         mkCmd = res: ''
             |                 ^
          660|             _iNote "Activating %s" "${res.name}"

       … while evaluating the attribute 'data'

       at /nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/lib/dag.nix:89:37:

           88|     in if sorted ? result then {
           89|       result = map (v: { inherit (v) name data; }) sorted.result;
             |                                     ^
           90|     } else

       … while evaluating the attribute 'data'

       at /nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/lib/dag.nix:83:9:

           82|         name = n;
           83|         data = v.data;
             |         ^
           84|         after = v.after ++ dagBefore dag n;

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'g'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/attrsets.nix:595:19:

          594|           g =
          595|             name: value:
             |                   ^
          596|             if isAttrs value && cond value

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/attrsets.nix:598:20:

          597|               then recurse (path ++ [name]) value
          598|               else f (path ++ [name]) value;
             |                    ^
          599|         in mapAttrs g;

       … while calling anonymous lambda

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:248:72:

          247|           # For definitions that have an associated option
          248|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          249|

       … while evaluating the attribute 'value'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:759:9:

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

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

       … while evaluating the attribute 'mergedValue'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:794:5:

          793|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          794|     mergedValue =
             |     ^
          795|       if isDefined then

       … while evaluating the attribute 'values'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:788:9:

          787|       in {
          788|         values = defs''';
             |         ^
          789|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:887:7:

          886|     in {
          887|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          888|       inherit highestPrio;

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:774:17:

          773|         # Process mkMerge and mkIf properties.
          774|         defs' = concatMap (m:
             |                 ^
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while calling anonymous lambda

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:774:28:

          773|         # Process mkMerge and mkIf properties.
          774|         defs' = concatMap (m:
             |                            ^
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/files.nix':

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:775:137:

          774|         defs' = concatMap (m:
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          776|         ) defs;

       … while calling 'dischargeProperties'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:846:25:

          845|   */
          846|   dischargeProperties = def:
             |                         ^
          847|     if def._type or "" == "merge" then

       … while evaluating the attribute 'value'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:599:44:

          598|       defnsByName' = byName "config" (module: value:
          599|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          600|         ) configs;

       … while evaluating call site

       at /nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/files.nix:299:12:

          298|         declare -A changedFiles
          299|       '' + concatMapStrings (v:
             |            ^
          300|         let

       … while calling 'concatMapStrings'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/strings.nix:59:25:

           58|   */
           59|   concatMapStrings = f: list: concatStrings (map f list);
             |                         ^
           60|

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling anonymous lambda

       at /nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/files.nix:299:30:

          298|         declare -A changedFiles
          299|       '' + concatMapStrings (v:
             |                              ^
          300|         let

       … while evaluating call site

       at /nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/files.nix:301:23:

          300|         let
          301|           sourceArg = escapeShellArg (sourceStorePath v);
             |                       ^
          302|           targetArg = escapeShellArg v.target;

       … while calling 'escapeShellArg'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/strings.nix:427:20:

          426|   */
          427|   escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
             |                    ^
          428|

       … while evaluating call site

       at /nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/files.nix:301:39:

          300|         let
          301|           sourceArg = escapeShellArg (sourceStorePath v);
             |                                       ^
          302|           targetArg = escapeShellArg v.target;

       … while calling 'sourceStorePath'

       at /nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/files.nix:15:21:

           14|
           15|   sourceStorePath = file:
             |                     ^
           16|     let

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'g'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/attrsets.nix:595:19:

          594|           g =
          595|             name: value:
             |                   ^
          596|             if isAttrs value && cond value

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/attrsets.nix:598:20:

          597|               then recurse (path ++ [name]) value
          598|               else f (path ++ [name]) value;
             |                    ^
          599|         in mapAttrs g;

       … while calling anonymous lambda

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:248:72:

          247|           # For definitions that have an associated option
          248|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          249|

       … while evaluating the attribute 'value'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:759:9:

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

       … while evaluating the option `home.file."/home/kraftc/.config/kitty/kitty.conf".source':

       … while evaluating the attribute 'mergedValue'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:794:5:

          793|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          794|     mergedValue =
             |     ^
          795|       if isDefined then

       … while evaluating the attribute 'values'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:788:9:

          787|       in {
          788|         values = defs''';
             |         ^
          789|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:887:7:

          886|     in {
          887|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          888|       inherit highestPrio;

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:774:17:

          773|         # Process mkMerge and mkIf properties.
          774|         defs' = concatMap (m:
             |                 ^
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while calling anonymous lambda

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:774:28:

          773|         # Process mkMerge and mkIf properties.
          774|         defs' = concatMap (m:
             |                            ^
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/i13s9jbv6fcwd4zfqsqbndnxwwiyxq6a-source/modules/misc/xdg.nix':

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:775:137:

          774|         defs' = concatMap (m:
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          776|         ) defs;

       … while calling 'dischargeProperties'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:846:25:

          845|   */
          846|   dischargeProperties = def:
             |                         ^
          847|     if def._type or "" == "merge" then

       … while evaluating the attribute 'value'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:599:44:

          598|       defnsByName' = byName "config" (module: value:
          599|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          600|         ) configs;

       … while evaluating call site

       at «none»:0: (source not available)

       … while calling 'g'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/attrsets.nix:595:19:

          594|           g =
          595|             name: value:
             |                   ^
          596|             if isAttrs value && cond value

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/attrsets.nix:598:20:

          597|               then recurse (path ++ [name]) value
          598|               else f (path ++ [name]) value;
             |                    ^
          599|         in mapAttrs g;

       … while calling anonymous lambda

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:248:72:

          247|           # For definitions that have an associated option
          248|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          249|

       … while evaluating the attribute 'value'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:759:9:

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

       … while evaluating the option `xdg.configFile."kitty/kitty.conf".source':

       … while evaluating the attribute 'mergedValue'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:794:5:

          793|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          794|     mergedValue =
             |     ^
          795|       if isDefined then

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:796:12:

          795|       if isDefined then
          796|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |            ^
          797|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling anonymous lambda

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:796:17:

          795|       if isDefined then
          796|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                 ^
          797|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/modules.nix:796:22:

          795|       if isDefined then
          796|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                      ^
          797|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling 'check'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/types.nix:490:15:

          489|       descriptionClass = "noun";
          490|       check = x: isStringLike x && builtins.substring 0 1 (toString x) == "/";
             |               ^
          491|       merge = mergeEqualOption;

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/make-derivation.nix:506:14:

          505|   meta = checkMeta.commonMeta { inherit validity attrs pos references; };
          506|   validity = checkMeta.assertValidity { inherit meta attrs; };
             |              ^
          507|

       … while calling 'assertValidity'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/check-meta.nix:442:20:

          441|
          442|   assertValidity = { meta, attrs }: let
             |                    ^
          443|       validity = checkValidity attrs;

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/check-meta.nix:443:18:

          442|   assertValidity = { meta, attrs }: let
          443|       validity = checkValidity attrs;
             |                  ^
          444|     in validity // {

       … while calling 'checkValidity'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/check-meta.nix:343:19:

          342|   # Along with a boolean flag for each reason
          343|   checkValidity = attrs:
             |                   ^
          344|     # Check meta attribute types first, to make sure it is always called even when there are other issues

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/check-meta.nix:362:13:

          361|     # --- Put checks that can be ignored here ---
          362|     else if hasDeniedUnfreeLicense attrs && !(hasAllowlistedLicense attrs) then
             |             ^
          363|       { valid = "no"; reason = "unfree"; errormsg = "has an unfree license (‘${showLicense attrs.meta.license}’)"; }

       … while calling 'hasDeniedUnfreeLicense'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/check-meta.nix:77:28:

           76|   # `allowUnfreePredicate` function.
           77|   hasDeniedUnfreeLicense = attrs:
             |                            ^
           78|     hasUnfreeLicense attrs &&

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/check-meta.nix:78:5:

           77|   hasDeniedUnfreeLicense = attrs:
           78|     hasUnfreeLicense attrs &&
             |     ^
           79|     !allowUnfree &&

       … while calling 'hasUnfreeLicense'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/check-meta.nix:51:22:

           50|
           51|   hasUnfreeLicense = attrs:
             |                      ^
           52|     hasLicense attrs &&

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/check-meta.nix:52:5:

           51|   hasUnfreeLicense = attrs:
           52|     hasLicense attrs &&
             |     ^
           53|     isUnfree (lib.lists.toList attrs.meta.license);

       … while calling 'hasLicense'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/stdenv/generic/check-meta.nix:34:16:

           33|
           34|   hasLicense = attrs:
             |                ^
           35|     attrs ? meta.license;

       … while evaluating call site

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/build-support/trivial-builders/default.nix:144:16:

          143|         passAsFile = [ "text" ];
          144|         meta = lib.optionalAttrs (executable && matches != null) {
             |                ^
          145|           mainProgram = lib.head matches;

       … while calling 'optionalAttrs'

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/attrsets.nix:675:5:

          674|     # The attribute set to return if `cond` is `true`.
          675|     as:
             |     ^
          676|     if cond then as else {};

       error: value is null while a Boolean was expected

       at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/build-support/trivial-builders/default.nix:144:35:

          143|         passAsFile = [ "text" ];
          144|         meta = lib.optionalAttrs (executable && matches != null) {
             |                                   ^
          145|           mainProgram = lib.head matches;

Additional context

Error happens on the nixos-unstable channel while rebuilding home-manager. I checked all the inputs and it's comming from one of the commits after 6b554aa

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
 - host os: `Linux 6.1.30, NixOS, 23.05 (Stoat), 23.05.20230529.0f7f5ca`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@hoidOS hoidOS changed the title Build failure: PACKAGENAME Build failure: error: value is null while a Boolean was expected May 30, 2023
@hoidOS
Copy link
Author

hoidOS commented May 30, 2023

With the debug option the build stops at:

checking access to '/nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/generators.nix'
evaluating file '/nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/lib/generators.nix'
setting 'homeConfigurations.USER.activationPackage.drvPath' to failed
error: value is null while a Boolean was expected

@hoidOS
Copy link
Author

hoidOS commented May 30, 2023

After further investigation i think the error originates from this commit 4431bab @figsoda

@dschrempf
Copy link
Contributor

I can confirm this issue. For me the trace involves some deprecation warnings (warnDeprecation).

@IncredibleLaser
Copy link
Contributor

After further investigation i think the error originates from this commit 4431bab @figsoda

I rather think that the error originates somewhere else and this commit tries to fix it, no? If you look at the report, it states

at /nix/store/ry6yyi3v01cpjak7spmmjrbk6hmd4zcq-source/pkgs/build-support/trivial-builders/default.nix:144:35:

          143|         passAsFile = [ "text" ];
          144|         meta = lib.optionalAttrs (executable && matches != null) {
             |                                   ^
          145|           mainProgram = lib.head matches;

The commit changes the offending line to meta = lib.optionalAttrs (toString executable != "" && matches != null) {.

I locally got the error value is null while a Boolean was expected, which is why the commit changes this to a string comparison. I don't know the result of toString on a null value though, so this might trigger further errors.

@berberman
Copy link
Member

FYI, toString null == "". 4431bab seems to be the fix to the error introduced in 4b94ae4.

@hoidOS
Copy link
Author

hoidOS commented May 30, 2023

I see. I have changed the input to nixpkgs-unstable from nixos-unstable and the error is gone. I guess the fix is not merged yet into nixos-unstable.
Thanks @berberman

@hoidOS
Copy link
Author

hoidOS commented May 30, 2023

Looks like this fix is going into the next nixos-unstable build.

@hoidOS hoidOS closed this as completed May 30, 2023
@Idris-9
Copy link

Idris-9 commented Jun 1, 2023

FYI, toString null == "". 4431bab seems to be the fix to the error introduced in 4b94ae4.

Hello I'm new to nixos can anyone tell or show guide how to fix this issue.

@hoidOS
Copy link
Author

hoidOS commented Jun 1, 2023

FYI, toString null == "". 4431bab seems to be the fix to the error introduced in 4b94ae4.

Hello I'm new to nixos can anyone tell or show guide how to fix this issue.

The issue is fixed and you need to update your channels.

@Janov911
Copy link

Janov911 commented Jun 9, 2023

not entirely:

uilding the system configuration...
error:
… while calling the 'head' builtin

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

      783|         || pred here (elemAt values 1) (head values) then
      784|           head values
         |           ^
      785|         else

   … while evaluating the attribute 'value'

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

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

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

   error: value is null while a Boolean was expected

@figsoda
Copy link
Member

figsoda commented Jun 9, 2023

I reverted the workaround since it was fixed in home manager: #235204, see discussions in #234862 and #235001

Can you post the error with --show-trace? it might be a different error

@Janov911
Copy link

Janov911 commented Jun 9, 2023

Reverted to earlier build, which seems to have fixed the issue for me at least

@gilescope
Copy link

I've updated everything on unstable and home manager still says:

trace: warning: literalExample is deprecated, use literalExpression instead, or use literalDocBook for a non-Nix description.
error: value is null while a Boolean was expected

       at /nix/store/1wyk10p3rpa48pyn0kk8vf7526j2bp3s-nixos/nixos/pkgs/build-support/trivial-builders/default.nix:144:35:

          143|         passAsFile = [ "text" ];
          144|         meta = lib.optionalAttrs (executable && matches != null) {

@figsoda
Copy link
Member

figsoda commented Jun 11, 2023

Can you post the error with --show-trace?

@alexvorobiev
Copy link
Contributor

I am getting the same error "while calling the 'head' builtin" with the home-manager nixos module. Here it is with --show-trace

unpacking channels...
building Nix...
building the system configuration...
error:
       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:780:24:

          779|     let f = attrPath:
          780|       zipAttrsWith (n: values:
             |                        ^
          781|         let here = attrPath ++ [n]; in

       … while calling 'g'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:599:19:

          598|           g =
          599|             name: value:
             |                   ^
          600|             if isAttrs value && cond value

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:602:20:

          601|               then recurse (path ++ [name]) value
          602|               else f (path ++ [name]) value;
             |                    ^
          603|         in mapAttrs g;

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:248:72:

          247|           # For definitions that have an associated option
          248|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          249|

       … while evaluating the option `system.build.toplevel':

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:774:28:

          773|         # Process mkMerge and mkIf properties.
          774|         defs' = concatMap (m:
             |                            ^
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix':

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:775:137:

          774|         defs' = concatMap (m:
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          776|         ) defs;

       … while calling 'dischargeProperties'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:846:25:

          845|   */
          846|   dischargeProperties = def:
             |                         ^
          847|     if def._type or "" == "merge" then

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:131:12:

          130|   # Replace runtime dependencies
          131|   system = foldr ({ oldDependency, newDependency }: drv:
             |            ^
          132|       pkgs.replaceDependency { inherit oldDependency newDependency drv; }

       … while calling 'foldr'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:53:20:

           52|   */
           53|   foldr = op: nul: list:
             |                    ^
           54|     let

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:60:8:

           59|         else op (elemAt list n) (fold' (n + 1));
           60|     in fold' 0;
             |        ^
           61|

       … while calling 'fold''

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:56:15:

           55|       len = length list;
           56|       fold' = n:
             |               ^
           57|         if n == len

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix:128:10:

          127|     then throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"
          128|     else showWarnings config.warnings baseSystem;
             |          ^
          129|

       … while calling 'showWarnings'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:414:28:

          413|
          414|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                            ^
          415|

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/trivial.nix:414:33:

          413|
          414|   showWarnings = warnings: res: lib.foldr (w: x: warn w x) res warnings;
             |                                 ^
          415|

       … while calling 'foldr'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:53:20:

           52|   */
           53|   foldr = op: nul: list:
             |                    ^
           54|     let

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:60:8:

           59|         else op (elemAt list n) (fold' (n + 1));
           60|     in fold' 0;
             |        ^
           61|

       … while calling 'fold''

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:56:15:

           55|       len = length list;
           56|       fold' = n:
             |               ^
           57|         if n == len

       … while calling 'g'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:599:19:

          598|           g =
          599|             name: value:
             |                   ^
          600|             if isAttrs value && cond value

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:602:20:

          601|               then recurse (path ++ [name]) value
          602|               else f (path ++ [name]) value;
             |                    ^
          603|         in mapAttrs g;

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:248:72:

          247|           # For definitions that have an associated option
          248|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          249|

       … while evaluating the option `warnings':

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:774:28:

          773|         # Process mkMerge and mkIf properties.
          774|         defs' = concatMap (m:
             |                            ^
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix':

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:775:137:

          774|         defs' = concatMap (m:
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          776|         ) defs;

       … while calling 'dischargeProperties'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:846:25:

          845|   */
          846|   dischargeProperties = def:
             |                         ^
          847|     if def._type or "" == "merge" then

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:543:10:

          542|     attrs:
          543|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
          544|

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:543:16:

          542|     attrs:
          543|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
          544|

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix:422:16:

          421|       mapAttrsToList
          422|         (name: service:
             |                ^
          423|           let

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix:429:16:

          428|             concatLists [
          429|               (optional (type == "oneshot" && (restart == "always" || restart == "on-success"))
             |                ^
          430|                 "Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'"

       … while calling 'optional'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/lists.nix:285:20:

          284|   */
          285|   optional = cond: elem: if cond then [elem] else [];
             |                    ^
          286|

       … while calling 'g'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:599:19:

          598|           g =
          599|             name: value:
             |                   ^
          600|             if isAttrs value && cond value

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:602:20:

          601|               then recurse (path ++ [name]) value
          602|               else f (path ++ [name]) value;
             |                    ^
          603|         in mapAttrs g;

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:248:72:

          247|           # For definitions that have an associated option
          248|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          249|

       … while evaluating the option `systemd.services.home-manager-alex.serviceConfig':

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:796:59:

          795|       if isDefined then
          796|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                                                           ^
          797|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling 'merge'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:529:20:

          528|       check = isAttrs;
          529|       merge = loc: defs:
             |                    ^
          530|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:530:35:

          529|       merge = loc: defs:
          530|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                                   ^
          531|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … while calling 'filterAttrs'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:309:5:

          308|     # The attribute set to filter
          309|     set:
             |     ^
          310|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:310:29:

          309|     set:
          310|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                             ^
          311|

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:310:62:

          309|     set:
          310|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                                                              ^
          311|

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:530:51:

          529|       merge = loc: defs:
          530|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                                                   ^
          531|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:530:86:

          529|       merge = loc: defs:
          530|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                                                                                      ^
          531|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:774:28:

          773|         # Process mkMerge and mkIf properties.
          774|         defs' = concatMap (m:
             |                            ^
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/home-manager/nixos':

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:775:137:

          774|         defs' = concatMap (m:
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          776|         ) defs;

       … while calling 'dischargeProperties'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:846:25:

          845|   */
          846|   dischargeProperties = def:
             |                         ^
          847|     if def._type or "" == "merge" then

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/make-derivation.nix:303:7

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

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/build-support/trivial-builders/default.nix:87:14:

           86|       enableParallelBuilding = true;
           87|       inherit buildCommand name;
             |              ^
           88|       passAsFile = [ "buildCommand" ]

       … while evaluating derivation 'activation-script'
         whose name attribute is located at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/make-derivation.nix:303:7

       … while evaluating attribute 'text' of derivation 'activation-script'

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/build-support/trivial-builders/default.nix:142:16:

          141|     runCommand name
          142|       { inherit text executable checkPhase allowSubstitutes preferLocalBuild;
             |                ^
          143|         passAsFile = [ "text" ];

       … while calling 'mkCmd'

         at /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/home-environment.nix:659:17:

          658|       let
          659|         mkCmd = res: ''
             |                 ^
          660|             _iNote "Activating %s" "${res.name}"

       … while calling 'g'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:599:19:

          598|           g =
          599|             name: value:
             |                   ^
          600|             if isAttrs value && cond value

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:602:20:

          601|               then recurse (path ++ [name]) value
          602|               else f (path ++ [name]) value;
             |                    ^
          603|         in mapAttrs g;

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:248:72:

          247|           # For definitions that have an associated option
          248|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          249|

       … while evaluating the option `home-manager.users.alex.home.activation.checkFilesChanged.data':

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:774:28:

          773|         # Process mkMerge and mkIf properties.
          774|         defs' = concatMap (m:
             |                            ^
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix':

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:775:137:

          774|         defs' = concatMap (m:
          775|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          776|         ) defs;

       … while calling 'dischargeProperties'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:846:25:

          845|   */
          846|   dischargeProperties = def:
             |                         ^
          847|     if def._type or "" == "merge" then

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix:299:12:

          298|         declare -A changedFiles
          299|       '' + concatMapStrings (v:
             |            ^
          300|         let

       … while calling 'concatMapStrings'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings.nix:59:25:

           58|   */
           59|   concatMapStrings = f: list: concatStrings (map f list);
             |                         ^
           60|

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix:299:30:

          298|         declare -A changedFiles
          299|       '' + concatMapStrings (v:
             |                              ^
          300|         let

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix:301:23:

          300|         let
          301|           sourceArg = escapeShellArg (sourceStorePath v);
             |                       ^
          302|           targetArg = escapeShellArg v.target;

       … while calling 'escapeShellArg'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/strings.nix:427:20:

          426|   */
          427|   escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
             |                    ^
          428|

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix:301:39:

          300|         let
          301|           sourceArg = escapeShellArg (sourceStorePath v);
             |                                       ^
          302|           targetArg = escapeShellArg v.target;

       … while calling 'sourceStorePath'

         at /nix/var/nix/profiles/per-user/root/channels/home-manager/modules/files.nix:15:21:

           14|
           15|   sourceStorePath = file:
             |                     ^
           16|     let

       … while calling 'g'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:599:19:

          598|           g =
          599|             name: value:
             |                   ^
          600|             if isAttrs value && cond value

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:602:20:

          601|               then recurse (path ++ [name]) value
          602|               else f (path ++ [name]) value;
             |                    ^
          603|         in mapAttrs g;

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:248:72:

          247|           # For definitions that have an associated option
          248|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          249|

       … while evaluating the option `home-manager.users.alex.home.file."/home/alex/.Xresources".source':

       … while calling anonymous lambda

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:796:17:

          795|       if isDefined then
          796|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                 ^
          797|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … from call site

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:796:22:

          795|       if isDefined then
          796|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                      ^
          797|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling 'check'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/types.nix:490:15:

          489|       descriptionClass = "noun";
          490|       check = x: isStringLike x && builtins.substring 0 1 (toString x) == "/";
             |               ^
          491|       merge = mergeEqualOption;

       … from call site

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/make-derivation.nix:506:14:

          505|   meta = checkMeta.commonMeta { inherit validity attrs pos references; };
          506|   validity = checkMeta.assertValidity { inherit meta attrs; };
             |              ^
          507|

       … while calling 'assertValidity'

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/check-meta.nix:442:20:

          441|
          442|   assertValidity = { meta, attrs }: let
             |                    ^
          443|       validity = checkValidity attrs;

       … from call site

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/check-meta.nix:443:18:

          442|   assertValidity = { meta, attrs }: let
          443|       validity = checkValidity attrs;
             |                  ^
          444|     in validity // {

       … while calling 'checkValidity'

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/check-meta.nix:343:19:

          342|   # Along with a boolean flag for each reason
          343|   checkValidity = attrs:
             |                   ^
          344|     # Check meta attribute types first, to make sure it is always called even when there are other issues

       … from call site

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/check-meta.nix:362:13:

          361|     # --- Put checks that can be ignored here ---
          362|     else if hasDeniedUnfreeLicense attrs && !(hasAllowlistedLicense attrs) then
             |             ^
          363|       { valid = "no"; reason = "unfree"; errormsg = "has an unfree license (‘${showLicense attrs.meta.license}’)"; }

       … while calling 'hasDeniedUnfreeLicense'

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/check-meta.nix:77:28:

           76|   # `allowUnfreePredicate` function.
           77|   hasDeniedUnfreeLicense = attrs:
             |                            ^
           78|     hasUnfreeLicense attrs &&

       … from call site

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/check-meta.nix:78:5:

           77|   hasDeniedUnfreeLicense = attrs:
           78|     hasUnfreeLicense attrs &&
             |     ^
           79|     !allowUnfree &&

       … while calling 'hasUnfreeLicense'

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/check-meta.nix:51:22:

           50|
           51|   hasUnfreeLicense = attrs:
             |                      ^
           52|     hasLicense attrs &&

       … from call site

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/check-meta.nix:52:5:

           51|   hasUnfreeLicense = attrs:
           52|     hasLicense attrs &&
             |     ^
           53|     isUnfree (lib.lists.toList attrs.meta.license);

       … while calling 'hasLicense'

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/stdenv/generic/check-meta.nix:34:16:

           33|
           34|   hasLicense = attrs:
             |                ^
           35|     attrs ? meta.license;

       … from call site

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/pkgs/build-support/trivial-builders/default.nix:144:16:

          143|         passAsFile = [ "text" ];
          144|         meta = lib.optionalAttrs (executable && matches != null) {
             |                ^
          145|           mainProgram = lib.head matches;

       … while calling 'optionalAttrs'

         at /nix/store/rjawpfgsbxv8bljijjcf8qx03blcdr3a-nixos/nixos/lib/attrsets.nix:679:5:

          678|     # The attribute set to return if `cond` is `true`.
          679|     as:
             |     ^
          680|     if cond then as else {};

       error: value is null while a Boolean was expected

@alexvorobiev
Copy link
Contributor

I think it fails at the same place as in the first message in this thread - the license check on some configuration file home-manager is trying to create - .Xresources in my case, kitty.conf in the first message. For the reference, here is the relevant code from my configuration:

  xresources = {
    extraConfig = (builtins.readFile (
        pkgs.fetchFromGitHub {
        owner = "DanManN";
        repo  = "base16-xresources";
        rev   = "52f4f75bbb7d1ec30b14e3bca9dc30483b255de1";
        sha256 = "0qqcnhlca100a77j3m9jki8y2cnkfq1h5y6gcw4160hjyam7f7c6";
      } + "/xresources/base16-solarized-dark-256.Xresources"
    ) + ''
      st.font:     Source Code Pro:pixelsize=17:antialias=true:autohint=true;
      st.termname: xterm-256color
    '');
  };

@alexvorobiev alexvorobiev reopened this Jun 12, 2023
@figsoda
Copy link
Member

figsoda commented Jun 12, 2023

What revision of home-manager are you using? Are you possibly running into nix-community/home-manager#4035?

@alexvorobiev
Copy link
Contributor

That was it! I have only recently switched to running home-manager as a NixOS module, so I expected the nixos-rebuild switch --upgrade to refresh all root's nix channels, not just nixos-unstable. running nix-channels --update as root fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants