notusknot / dotfiles-nix

Configuration files for my NixOS machine, declared by home-manager
MIT License
464 stars 30 forks source link

Error when run `sudo nixos-rebuild switch --flake .#lk-station --show-trace` #10

Closed ahaxu closed 10 months ago

ahaxu commented 1 year ago

i got this error msg when run

sudo nixos-rebuild switch --flake .#lk-station --show-trace
warning: Git tree '/home/lk/.config/nixos' is dirty
warning: input 'nur' has an override for a non-existent input 'nixpkgs'
error: getting status of '/nix/store/6w1xm6chg79qpkzlngdraj2i2pf5c7a8-source/hosts/lk-station': No such file or directory

       … while realising the context of path '/nix/store/6w1xm6chg79qpkzlngdraj2i2pf5c7a8-source/hosts/lk-station/hardware-configuration.nix'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:376:99:

          375|           throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}"
          376|         else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args);
             |                                                                                                   ^
          377|

       … while evaluating 'isFunction'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/trivial.nix:448:16:

          447|   */
          448|   isFunction = f: builtins.isFunction f ||
             |                ^
          449|     (f ? __functor && isFunction (f.__functor f));

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:474:78:

          473|
          474|   applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
             |                                                                              ^
          475|     let

       … while evaluating 'applyModuleArgsIfFunction'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:474:39:

          473|
          474|   applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
             |                                       ^
          475|     let

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:376:59:

          375|           throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}"
          376|         else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args);
             |                                                           ^
          377|

       … while evaluating 'unifyModuleSyntax'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:443:34:

          442|      of ‘options’, ‘config’ and ‘imports’ attributes. */
          443|   unifyModuleSyntax = file: key: m:
             |                                  ^
          444|     let

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:376:14:

          375|           throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}"
          376|         else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args);
             |              ^
          377|

       … while evaluating 'loadModule'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:370:53:

          369|       # Like unifyModuleSyntax, but also imports paths and calls functions if necessary
          370|       loadModule = args: fallbackFile: fallbackKey: m:
             |                                                     ^
          371|         if isFunction m || isAttrs m then

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:411:22:

          410|           let
          411|             module = loadModule args parentFile "${parentKey}:anon-${toString n}" x;
             |                      ^
          412|             collectedImports = collectStructuredModules module._file module.key module.imports args;

       … while evaluating the attribute 'disabled'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:406:13:

          405|           collectResults = modules: {
          406|             disabled = concatLists (catAttrs "disabled" modules);
             |             ^
          407|             inherit modules;

       … while evaluating anonymous lambda

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:428:31:

          427|           disabledKeys = map moduleKey disabled;
          428|           keyFilter = filter (attrs: ! elem attrs.key disabledKeys);
             |                               ^
          429|         in map (attrs: attrs.module) (builtins.genericClosure {

       … from call site

       … while evaluating 'filterModules'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:424:36:

          423|       # modules recursively. It returns the final list of unique-by-key modules
          424|       filterModules = modulesPath: { disabled, modules }:
             |                                    ^
          425|         let

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:435:7:

          434|     in modulesPath: initialModules: args:
          435|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |       ^
          436|

       … while evaluating anonymous lambda

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:434:37:

          433|
          434|     in modulesPath: initialModules: args:
             |                                     ^
          435|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:280:25:

          279|       merged =
          280|         let collected = collectModules
             |                         ^
          281|           (specialArgs.modulesPath or "")

       … while evaluating 'reverseList'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/lists.nix:394:17:

          393|   */
          394|   reverseList = xs:
             |                 ^
          395|     let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:284:33:

          283|           ({ inherit lib options config specialArgs; } // specialArgs);
          284|         in mergeModules prefix (reverseList collected);
             |                                 ^
          285|

       … while evaluating 'byName'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:550:25:

          549|       */
          550|       byName = attr: f: modules:
             |                         ^
          551|         zipAttrsWith (n: concatLists)

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:567:21:

          566|       # an attrset 'name' => list of submodules that declare ‘name’.
          567|       declsByName = byName "options" (module: option:
             |                     ^
          568|           [{ inherit (module) _file; options = option; }]

       … while evaluating the attribute 'matchedOptions'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:646:14:

          645|     in {
          646|       inherit matchedOptions;
             |              ^
          647|

       … while evaluating 'mapAttrsRecursiveCond'

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/attrsets.nix:393:36:

          392|   */
          393|   mapAttrsRecursiveCond = cond: f: set:
             |                                    ^
          394|     let

       … from call site

       at /nix/store/xsqw5wd5lqgjz3z752zbnywp8zjxv4nw-source/lib/modules.nix:292:28:

          291|           # For definitions that have an associated option
          292|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                            ^
          293|
notusknot commented 1 year ago

Can you send the error message without —show-trace?

ahaxu commented 1 year ago

Hi @notusknot

Can you send the error message without —show-trace?

here is the error message without --show-trace

sudo nixos-rebuild switch --flake .#lk-station

warning: Git tree '/home/lk/.config/nixos' is dirty
warning: input 'nur' has an override for a non-existent input 'nixpkgs'
error: getting status of '/nix/store/hqgj1m02nf32c2n1rqm6rhq6ci315m1w-source/hosts/lk-station': No such file or directory
(use '--show-trace' to show detailed location information)
apisandipas commented 1 year ago

error: getting status of '/nix/store/hqgj1m02nf32c2n1rqm6rhq6ci315m1w-source/hosts/lk-station': No such file or directory

I solved this by replacing the hostname in ./modules/configuration.nix with my new host name

zinou8888 commented 1 year ago

it did not work for me, which line exactly did you change ?

jedwoolley commented 1 year ago

inside the .config/nixos directory I ran git add .

ahaxu commented 10 months ago

inside the .config/nixos directory I ran git add .

thank you @jedwoolley , this resolved my issue.