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

bug: home-manager and nix-darwin error with end-of-file on nixpkgs-unstable #3508

Closed
2 tasks done
lamdor opened this issue Dec 19, 2022 · 1 comment
Closed
2 tasks done
Assignees
Labels
bug triage Issues or feature request that have not been triaged yet

Comments

@lamdor
Copy link

lamdor commented Dec 19, 2022

Are you following the right branch?

  • My Nixpkgs and Home Manager versions are in sync

Is there an existing issue for this?

  • I have searched the existing issues

Issue description

Hi, I started getting a end-of-file error while using home-manager with nix-darwin and nix flakes as of a couple of weeks ago. I've distilled it down into a minimal workable example: https://github.com/lamdor/nix-darwin-home-manager-eof-mwe Which doesn't do anything, but blows up with:

❯ nix build github:lamdor/nix-darwin-home-manager-eof-mwe#darwinConfigurations.test.system
error: unexpected end-of-file
(use '--show-trace' to show detailed location information)

Which isn't that very helpful...

When doing the --show-trace, I get

Full output
❯ nix build github:lamdor/nix-darwin-home-manager-eof-mwe#darwinConfigurations.test.system --show-trace
error: unexpected end-of-file

       … while evaluating the attribute 'buildCommand' of the derivation 'options-db.xml'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'passAsFile'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/build-support/buildenv/default.nix:77:5:

           76|     # XXX: The size is somewhat arbitrary
           77|     passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
             |     ^
           78|   }

       … while evaluating the attribute 'passAsFile' of the derivation 'nmd-documents'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'buildCommand' of the derivation 'manual-combined'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'buildCommand' of the derivation 'manual-olinkdb'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'buildCommand' of the derivation 'man-pages'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'passAsFile'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/build-support/buildenv/default.nix:77:5:

           76|     # XXX: The size is somewhat arbitrary
           77|     passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
             |     ^
           78|   }

       … while evaluating the attribute 'passAsFile' of the derivation 'home-manager-fonts'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while evaluating the attribute 'value'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:563:44:

          562|       defnsByName' = byName "config" (module: value:
          563|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          564|         ) configs;

       … while calling 'dischargeProperties'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:810:25:

          809|   */
          810|   dischargeProperties = def:
             |                         ^
          811|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:739:137:

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

       … while evaluating definitions from `/nix/store/6sbr4qzw8frzbpnj4lxhhrk30yaa4z17-source/modules/targets/darwin/fonts.nix':

       … while calling anonymous lambda

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:738:28:

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

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:738:17:

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

       … while evaluating the attribute 'values'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:851:7:

          850|     in {
          851|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          852|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:752:9:

          751|       in {
          752|         values = defs''';
             |         ^
          753|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:758:5:

          757|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          758|     mergedValue =
             |     ^
          759|       if isDefined then

       … while evaluating the option `home-manager.users.test.home.activation.copyFonts.data':

       … while evaluating the attribute 'value'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:723:9:

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

       … while calling anonymous lambda

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:265:72:

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

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/attrsets.nix:532:20:

          531|               then recurse (path ++ [name]) value
          532|               else f (path ++ [name]) value;
             |                    ^
          533|         in mapAttrs g;

       … while calling 'g'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/attrsets.nix:529:19:

          528|           g =
          529|             name: value:
             |                   ^
          530|             if isAttrs value && cond value

       … from call site

       … while evaluating the attribute 'data'

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

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

       … while evaluating the attribute 'data'

       at /nix/store/6sbr4qzw8frzbpnj4lxhhrk30yaa4z17-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 calling 'mkCmd'

       at /nix/store/6sbr4qzw8frzbpnj4lxhhrk30yaa4z17-source/modules/home-environment.nix:657:17:

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

       … from call site

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

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

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

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

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

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

       … while calling anonymous lambda

       at /nix/store/6sbr4qzw8frzbpnj4lxhhrk30yaa4z17-source/nix-darwin/default.nix:16:36:

           15|       system.activationScripts.postActivation.text = concatStringsSep "\n"
           16|         (mapAttrsToList (username: usercfg: ''
             |                                    ^
           17|           echo Activating home-manager configuration for ${username}

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/attrsets.nix:478:16:

          477|     attrs:
          478|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
          479|

       … while calling anonymous lambda

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/attrsets.nix:478:10:

          477|     attrs:
          478|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
          479|

       … from call site

       … while evaluating the attribute 'value'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:563:44:

          562|       defnsByName' = byName "config" (module: value:
          563|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          564|         ) configs;

       … while calling 'dischargeProperties'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:810:25:

          809|   */
          810|   dischargeProperties = def:
             |                         ^
          811|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:739:137:

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

       … while evaluating definitions from `<unknown-file>':

       … while calling anonymous lambda

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:738:28:

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

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:738:17:

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

       … while evaluating the attribute 'values'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:851:7:

          850|     in {
          851|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          852|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:752:9:

          751|       in {
          752|         values = defs''';
             |         ^
          753|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:758:5:

          757|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          758|     mergedValue =
             |     ^
          759|       if isDefined then

       … while evaluating the option `system.activationScripts.postActivation.text':

       … while evaluating the attribute 'value'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:723:9:

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

       … while calling anonymous lambda

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:265:72:

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

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/attrsets.nix:532:20:

          531|               then recurse (path ++ [name]) value
          532|               else f (path ++ [name]) value;
             |                    ^
          533|         in mapAttrs g;

       … while calling 'g'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/attrsets.nix:529:19:

          528|           g =
          529|             name: value:
             |                   ^
          530|             if isAttrs value && cond value

       … from call site

       … while evaluating the attribute 'value'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:563:44:

          562|       defnsByName' = byName "config" (module: value:
          563|           [{ inherit (module) file; inherit value; }]
             |                                            ^
          564|         ) configs;

       … while calling 'dischargeProperties'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:810:25:

          809|   */
          810|   dischargeProperties = def:
             |                         ^
          811|     if def._type or "" == "merge" then

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:739:137:

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

       … while evaluating definitions from `/nix/store/b7mv8hq1amfaqim5mxvdkdbpmmk02n9y-source/modules/system/activation-scripts.nix':

       … while calling anonymous lambda

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:738:28:

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

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:738:17:

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

       … while evaluating the attribute 'values'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:851:7:

          850|     in {
          851|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
          852|       inherit highestPrio;

       … while evaluating the attribute 'values'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:752:9:

          751|       in {
          752|         values = defs''';
             |         ^
          753|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:758:5:

          757|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          758|     mergedValue =
             |     ^
          759|       if isDefined then

       … while evaluating the option `system.activationScripts.script.text':

       … while evaluating the attribute 'value'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:723:9:

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

       … while calling anonymous lambda

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/modules.nix:265:72:

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

       … from call site

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/attrsets.nix:532:20:

          531|               then recurse (path ++ [name]) value
          532|               else f (path ++ [name]) value;
             |                    ^
          533|         in mapAttrs g;

       … while calling 'g'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/lib/attrsets.nix:529:19:

          528|           g =
          529|             name: value:
             |                   ^
          530|             if isAttrs value && cond value

       … from call site

       … while evaluating the attribute 'activationScript' of the derivation 'darwin-system-23.05.20221219.bb31220+darwin4.adb8ac0'

       at /nix/store/1zzy0v6laha6r67l0n3wqkgqiwvvj7hv-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270|       name =
             |       ^
          271|         let

When I remove the home-manager.users.test = { home.stateVersion = "21.11"; }; line, basically not using any of home-manager, but still using nix-darwin, it works fine. What's odd is that I can revert my nixpkgs lock back to a commit prior to Dec 8th, and things work fine.

I've bisected nixpkgs to show that NixOS/nixpkgs#199363 was the PR that this MWE started breaking. Which is interesting since I think options-db.xml has something to do with docs and so does that PR.

Does anyone have any ideas on how to fix and what to look at next?

Maintainer CC

@midchildan @ncf

System information

- system: `"aarch64-darwin"`
 - host os: `Darwin 22.1.0, macOS 13.0.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.12.0`
 - channels(luke): `"nixpkgs"`
 - channels(root): `"nixpkgs-22.05pre340506.5c37ad87222"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@lamdor lamdor added bug triage Issues or feature request that have not been triaged yet labels Dec 19, 2022
@lamdor
Copy link
Author

lamdor commented Dec 29, 2022

I finally figured out that I'm running into #3344

@lamdor lamdor closed this as completed Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Issues or feature request that have not been triaged yet
Projects
None yet
Development

No branches or pull requests

4 participants