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

infinite recursion error related to whether a git repo exists #408 #413

Closed
jackmac92 opened this issue Jan 6, 2022 · 5 comments
Closed
Labels
enhancement New feature or request

Comments

@jackmac92
Copy link
Contributor

Is the project currrently in a state where the quick start should be working (would understand if #400 is an issue)

I've been trying to use this project to create my first nixos config, but have been running into some issues with the bespoke iso installer.

If this is not a known issue, happy to add a more detailed bug report, (the issue may be/ likely is me, but I figure this project aims to be friendly to the uninitated, maybe just needs clearer docs)

@jackmac92 jackmac92 added the enhancement New feature or request label Jan 6, 2022
@nrdxp
Copy link
Collaborator

nrdxp commented Jan 6, 2022

Yeah we definitely want this project to be as easy to bootstrap for new Nixers as possible. As far as I know the quickstart should be accurate, but it has been a while since I started from scratch so perhaps something has changed. Just give us a few more details about the specific issue, and we'll see if we can track it down.

@jackmac92
Copy link
Contributor Author

jackmac92 commented Jan 7, 2022

awesome! going to add some notes here as a go

first minor thing, on initial install, should the user do anything in the nix-shell before exiting?

Before #409 you would need to exit the nix-shell in order to initialize the repo/ create the first commit, but now maybe these can just be removed?


For building the ISO, I think adding some context to the docs here could be really helpful. E.g. I think that "bootstrapIso" is a specific "type" of bud build, but not sure

bud build bootstrap bootstrapIso
sudo -E $(which bud) burn

Also some docs/context on how/when to use bud vm would be great. It looks like that is an easy way to test things out without the hassle of a full install (will follow up with the issues I've had in bud vm, but this is the area where I think it's most likely I'm just not using it correctly)

Rerunning my attempt to install again so I can get the stacktraces

@jackmac92
Copy link
Contributor Author

I think my main issue is an infinite recursion error in /iso/devos/, so I run nixos-instal --flake .#NixOS, but not bud up

❯ direnv allow
direnv: loading /iso/devos/.envrc
direnv: using flake
environment:961: use_flake: command not found
direnv: using nix
direnv: ([/nix/store/jmxlzrhv59v1paa2snyqhz58156j8aba-direnv-2.28.0/bin/direnv export bash]) is taking a while to execute. Use CTRL-C to give up.
error: infinite recursion encountered

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:585:9:

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

       … while evaluating the attribute 'value'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:585:9:

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

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:171:72:

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

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:304:20:

          303|               then recurse (path ++ [name]) value
          304|               else f (path ++ [name]) value;
             |                    ^
          305|         in mapAttrs g set;

       … while evaluating 'g'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:301:19:

          300|           g =
          301|             name: value:
             |                   ^
          302|             if isAttrs value && cond value

       … from call site

       … while evaluating the attribute 'checks'

       at /nix/store/nvkkhnbjmghwl4d2sbr4s8qpv5fg5i9k-source/src/mkFlake/outputs-builder.nix:64:3:

           63|
           64|   checks =
             |   ^
           65|     (

       … while evaluating anonymous lambda

       at /nix/store/zzp9cqzfqmsqxkxbz3k17q5kp5n48xsv-source/flake.nix:34:20:

           33|           lhs // mapAttrs
           34|             (name: value:
             |                    ^
           35|               if isAttrs value then lhs.${name} or { } // value

       … from call site

       … while evaluating 'id'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/trivial.nix:14:5:

           13|     # The value to return
           14|     x: x;
             |     ^
           15|

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:217:47:

          216|           let
          217|             evalNext = x: mapAny (depth + 1) (transform (depth + 1) x);
             |                                               ^
          218|           in

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:215:40:

          214|           else id;
          215|         mapAny = with builtins; depth: v:
             |                                        ^
          216|           let

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:217:27:

          216|           let
          217|             evalNext = x: mapAny (depth + 1) (transform (depth + 1) x);
             |                           ^
          218|           in

       … while evaluating 'evalNext'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:217:24:

          216|           let
          217|             evalNext = x: mapAny (depth + 1) (transform (depth + 1) x);
             |                        ^
          218|           in

       … from call site

       … while evaluating 'go'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:237:18:

          236|     let
          237|     go = indent: v: with builtins;
             |                  ^
          238|     let     isPath   = v: typeOf v == "path";

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:282:57:

          281|               (name: value:
          282|                 "${libStr.escapeNixIdentifier name} = ${go (indent + "  ") value};") v)
             |                                                         ^
          283|         + outroSpace + "}"

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:281:22:

          280|           + libStr.concatStringsSep introSpace (libAttr.mapAttrsToList
          281|               (name: value:
             |                      ^
          282|                 "${libStr.escapeNixIdentifier name} = ${go (indent + "  ") value};") v)

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:259:16:

          258|   mapAttrsToList = f: attrs:
          259|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
          260|

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:259:10:

          258|   mapAttrsToList = f: attrs:
          259|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
          260|

       … from call site

       … while evaluating 'go'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:237:18:

          236|     let
          237|     go = indent: v: with builtins;
             |                  ^
          238|     let     isPath   = v: typeOf v == "path";

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:282:57:

          281|               (name: value:
          282|                 "${libStr.escapeNixIdentifier name} = ${go (indent + "  ") value};") v)
             |                                                         ^
          283|         + outroSpace + "}"

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:281:22:

          280|           + libStr.concatStringsSep introSpace (libAttr.mapAttrsToList
          281|               (name: value:
             |                      ^
          282|                 "${libStr.escapeNixIdentifier name} = ${go (indent + "  ") value};") v)

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:259:16:

          258|   mapAttrsToList = f: attrs:
          259|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
          260|

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:259:10:

          258|   mapAttrsToList = f: attrs:
          259|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
          260|

       … from call site

       … while evaluating 'go'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/generators.nix:237:18:

          236|     let
          237|     go = indent: v: with builtins;
             |                  ^
          238|     let     isPath   = v: typeOf v == "path";

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/options.nix:269:10:

          268|       prettyEval = builtins.tryEval
          269|         (lib.generators.toPretty { }
             |          ^
          270|           (lib.generators.withRecursion { depthLimit = 10; throwOnDepthLimit = false; } def.value));

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/options.nix:265:38:

          264|
          265|   showDefs = defs: concatMapStrings (def:
             |                                      ^
          266|     let

       … from call site

       … while evaluating 'concatMapStrings'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/strings.nix:53:25:

           52|   */
           53|   concatMapStrings = f: list: concatStrings (map f list);
             |                         ^
           54|

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/options.nix:265:20:

          264|
          265|   showDefs = defs: concatMapStrings (def:
             |                    ^
          266|     let

       … while evaluating 'showDefs'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/options.nix:265:14:

          264|
          265|   showDefs = defs: concatMapStrings (def:
             |              ^
          266|     let

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:621:121:

          620|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;
          621|         in throw "A definition for option `${showOption loc}' is not of type `${type.description}'. Definition values:${showDefs allInvalid}"
             |                                                                                                                         ^
          622|       else

       … while evaluating the attribute 'mergedValue'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:617:5:

          616|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          617|     mergedValue =
             |     ^
          618|       if isDefined then

       … while evaluating the option `self':

       … while evaluating the attribute 'value'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:585:9:

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

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:171:72:

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

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:304:20:

          303|               then recurse (path ++ [name]) value
          304|               else f (path ++ [name]) value;
             |                    ^
          305|         in mapAttrs g set;

       … while evaluating 'g'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:301:19:

          300|           g =
          301|             name: value:
             |                   ^
          302|             if isAttrs value && cond value

       … from call site

       … while evaluating the attribute 'default'

       at /nix/store/nvkkhnbjmghwl4d2sbr4s8qpv5fg5i9k-source/src/mkFlake/options.nix:258:7:

          257|       type = flakeType;
          258|       default = config.self.inputs.${name};
             |       ^
          259|       defaultText = "config.self.inputs.<name>";

       … while evaluating the attribute 'value.content'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:768:14:

          767|     { _type = "override";
          768|       inherit priority content;
             |              ^
          769|     };

       … while evaluating the attribute 'value._type'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:708:73:

          707|       highestPrio = foldl' (prio: def: min (getPrio def) prio) 9999 defs;
          708|       strip = def: if def.value._type or "" == "override" then def // { value = def.value.content; } else def;
             |                                                                         ^
          709|     in {

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:607:19:

          606|           # Avoid sorting if we don't have to.
          607|           if any (def: def.value._type or "" == "order") defs''.values
             |                   ^
          608|           then sortProperties defs''.values

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:607:14:

          606|           # Avoid sorting if we don't have to.
          607|           if any (def: def.value._type or "" == "order") defs''.values
             |              ^
          608|           then sortProperties defs''.values

       … while evaluating the attribute 'values'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:611:9:

          610|       in {
          611|         values = defs''';
             |         ^
          612|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:617:5:

          616|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          617|     mergedValue =
             |     ^
          618|       if isDefined then

       … while evaluating the option `channels.nixos.input':

       … while evaluating the attribute 'value'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:585:9:

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

       … while evaluating anonymous lambda

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/modules.nix:171:72:

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

       … from call site

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:304:20:

          303|               then recurse (path ++ [name]) value
          304|               else f (path ++ [name]) value;
             |                    ^
          305|         in mapAttrs g set;

       … while evaluating 'g'

       at /nix/store/bxapqbai4fnwm7297y02m9gjhz9w959n-source/lib/attrsets.nix:301:19:

          300|           g =
          301|             name: value:
             |                   ^
          302|             if isAttrs value && cond value

       … from call site

       … while evaluating 'patchChannel'

       at /nix/store/zzp9cqzfqmsqxkxbz3k17q5kp5n48xsv-source/flake.nix:41:41:

           40|
           41|         patchChannel = system: channel: patches:
             |                                         ^
           42|           if patches == [ ] then channel else

       … from call site

       at /nix/store/zzp9cqzfqmsqxkxbz3k17q5kp5n48xsv-source/lib/mkFlake.nix:211:47:

          210|       let
          211|         importChannel = name: value: (import (patchChannel system value.input (value.patches or [ ])) {
             |                                               ^
          212|           inherit system;

       … while evaluating 'importChannel'

       at /nix/store/zzp9cqzfqmsqxkxbz3k17q5kp5n48xsv-source/lib/mkFlake.nix:211:31:

          210|       let
          211|         importChannel = name: value: (import (patchChannel system value.input (value.patches or [ ])) {
             |                               ^
          212|           inherit system;

       … from call site

       … while evaluating the attribute 'shell'

       at /nix/store/497ak1gmjg2zpd52ivbzcbq0gp9rapiv-source/modules/default.nix:23:3:

           22|
           23|   shell = module.config.devshell.shell;
             |   ^
           24| }

       … while evaluating the attribute 'devShell'

       at /nix/store/nvkkhnbjmghwl4d2sbr4s8qpv5fg5i9k-source/src/mkFlake/outputs-builder.nix:51:3:

           50|
           51|   devShell =
             |   ^
           52|     let

       … while evaluating anonymous lambda

       at /nix/store/zzp9cqzfqmsqxkxbz3k17q5kp5n48xsv-source/flake.nix:34:20:

           33|           lhs // mapAttrs
           34|             (name: value:
             |                    ^
           35|               if isAttrs value then lhs.${name} or { } // value

       … from call site

       … while evaluating the attribute 'devShell.x86_64-linux'

       at /nix/store/qcvnd2dsa5a3h4gq8x5x7hds6z85i4dw-source/default.nix:103:26:

          102|                   then (pushDownSystem system (attrs.hydraJobs or {}) ret.hydraJobs)
          103|                   else { ${system} = ret.${key}; };
             |                          ^
          104|             in attrs //

(too much) detail on how I get to the above error

main attempts to install have been in virt-manager. I only make one change to the repo before starting, to add serial console support for easier access to the vm.

boot.kernelParams = [  "console=tty1" "console=ttyS0,115200"  ];

I follow the quickstart to generate the bespoke iso image. And then use that image the same way I've used an official nixos iso to install nix in a vm.

I get through the install stage bootstrapping, but direnv fails to load the .envrc and nix-shell gets an infinite recursion error. So I'm not able to run bud up as the next steps instruct. I try rebooting since nixos-install appears to succeed. However the vm fails to boot, as it can't find the disk labelled nixos.

I think I usually run nixos-generate-config to install in a VM, that seems like the most likely fix for the disk missing on reboot. But figure the broken nix-shell is probably a bigger problem at the moment

@jackmac92
Copy link
Contributor Author

looking through other issues I see a lot of my issue is a duplicate of #372

but the above infinite recursion does seem to be a bug not related to the documentation. I also noticed it appears to be the exact same error I had in #408

but previously the error occured on the initial call to nix-shell, before building an iso, now it occurs within the booted bespoke iso

according to @Pacman99

... I think this is caused by devos not being a git repository. I think bud get needs to be updated to just do git clone https://github.com/divnix/devos

so I tried to create a git repo, but can't because it is a ready only file system

@jackmac92 jackmac92 changed the title Expand on Quickstart guide Follow up on #408 Jan 8, 2022
@jackmac92 jackmac92 changed the title Follow up on #408 infinite recursion error related to whether a git repo exists #408 Jan 8, 2022
@Pacman99
Copy link
Member

I think I know whats wrong, the offending line is here:

default = config.self.inputs.${name};

I think it can just be fixed with self.inputs.${name}.

@bors bors bot closed this as completed Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants