nixos-install error with modules.nix #17

Closed
opened 2025-12-29 04:20:48 +01:00 by adam · 1 comment
Owner

Originally created by @bitFlow66 on GitHub (Dec 6, 2023).

Hi, I am new to Nixos and wanted to have quickstart with your awesome config, but I am stuck with an error while using "nixos-install ....".

Not sure if I made mistake or if it is a general error. So I decided to post here after a long search on google.

Used command:
nixos-install --root /mnt --flake .#ai --no-root-password --option substituters "https://mirror.sjtu.edu.cn/nix-channels/store"

Error:

building the flake in git+file:///root/nix-config...
warning: Git tree '/root/nix-config' is dirty
error:
       … while calling the 'seq' builtin
 
         at /mnt/nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-source/lib/modules.nix:320:18:
 
          319|         options = checked options;
          320|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          321|         _module = checked (config._module);
 
       … while evaluating a branch condition
 
         at /mnt/nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-source/lib/modules.nix:261:9:
 
          260|       checkUnmatched =
          261|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
             |         ^
          262|           let
 
       (stack trace truncated; use '--show-trace' to show the full trace)
 
       error: infinite recursion encountered
 
       at /mnt/nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-source/lib/modules.nix:506:28:
 
          505|         builtins.addErrorContext (context name)
          506|           (args.${name} or config._module.args.${name})
             |                            ^
          507|       ) (lib.functionArgs f);

Thanks for your help in advance.

Originally created by @bitFlow66 on GitHub (Dec 6, 2023). Hi, I am new to Nixos and wanted to have quickstart with your awesome config, but I am stuck with an error while using "nixos-install ....". Not sure if I made mistake or if it is a general error. So I decided to post here after a long search on google. Used command: `nixos-install --root /mnt --flake .#ai --no-root-password --option substituters "https://mirror.sjtu.edu.cn/nix-channels/store"` Error: ``` building the flake in git+file:///root/nix-config... warning: Git tree '/root/nix-config' is dirty error: … while calling the 'seq' builtin at /mnt/nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-source/lib/modules.nix:320:18: 319| options = checked options; 320| config = checked (removeAttrs config [ "_module" ]); | ^ 321| _module = checked (config._module); … while evaluating a branch condition at /mnt/nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-source/lib/modules.nix:261:9: 260| checkUnmatched = 261| if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then | ^ 262| let (stack trace truncated; use '--show-trace' to show the full trace) error: infinite recursion encountered at /mnt/nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-source/lib/modules.nix:506:28: 505| builtins.addErrorContext (context name) 506| (args.${name} or config._module.args.${name}) | ^ 507| ) (lib.functionArgs f); ``` Thanks for your help in advance.
adam added the bug label 2025-12-29 04:20:48 +01:00
adam closed this issue 2025-12-29 04:20:48 +01:00
Author
Owner

@ryan4yin commented on GitHub (Dec 7, 2023):

Fixed by 6879049fa4

After adding --show-trace option, the error log should be:

# ...

         at /nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-sour
lib/modules.nix:504:44:

          503|       context = name: ''while evaluating the 
ule argument `${name}' in "${key}":'';
          504|       extraArgs = builtins.mapAttrs (name: _:
             |                                            ^
          505|         builtins.addErrorContext (context nam

       … while evaluating the module argument `impermanence'
 "/nix/store/5im7msrlkb1ka1syaq4vb90vlpxdbifg-source/imperma
ce.nix":

       error: infinite recursion encountered

       at /nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-source
b/modules.nix:506:28:

          505|         builtins.addErrorContext (context nam
          506|           (args.${name} or config._module.arg
{name})
             |                            ^
          507|       ) (lib.functionArgs f);

The error indicates nix could not found an argument named impermanence in its args and specialArgs.

@ryan4yin commented on GitHub (Dec 7, 2023): Fixed by https://github.com/ryan4yin/nix-config/commit/6879049fa445b5a0ff69248426b49efa42b8fcdd After adding `--show-trace` option, the error log should be: ``` # ... at /nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-sour lib/modules.nix:504:44: 503| context = name: ''while evaluating the ule argument `${name}' in "${key}":''; 504| extraArgs = builtins.mapAttrs (name: _: | ^ 505| builtins.addErrorContext (context nam … while evaluating the module argument `impermanence' "/nix/store/5im7msrlkb1ka1syaq4vb90vlpxdbifg-source/imperma ce.nix": error: infinite recursion encountered at /nix/store/gjd1iiwgwv7x29b21ng2dpysbgjp6kxr-source b/modules.nix:506:28: 505| builtins.addErrorContext (context nam 506| (args.${name} or config._module.arg {name}) | ^ 507| ) (lib.functionArgs f); ``` The error indicates nix could not found an argument named [impermanence](https://github.com/ryan4yin/nix-config/blob/nixos-install/impermanence.nix#L2) in its `args` and `specialArgs`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/nix-config-ryan4yin#17