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

Attempting to clone your config and have met with errors. Requesting any insight you can spare #18

Closed
pyunramura opened this issue Oct 4, 2023 · 5 comments

Comments

@pyunramura
Copy link

Hey, I'm currently attempting to clone your config, specifically your "io" host. And while I was able to build the flake into a vm with nixos-rebuild build-vm github:fufexan/dotfiles#io and boot it up successfully I'm unfortunately getting errors while attempting to deploy it onto baremetal. I'm fairly new to NixOS flakes and while I do have a working flake deployment I'm not really happy with it and am in the process of blowing it away in lieu of the one you have configured as it's fantastic. I've forked your config already and just made a few small alterations such as changing the username, and disabling howdy and the ir-emitter since I'm deploying onto an AMD desktop and don't have any method of biometric authentication. I was hoping you might have some insight into the errors that I'm seeing, and I sincerely appreciate any insight you have.

I can provide you some error logs if you'd like but I'm not sure if I should drop them here or a pastebin service, etc. Just let me know if you'd be willing. Thanks for the consideration.

@fufexan
Copy link
Owner

fufexan commented Oct 5, 2023

@pyunramura have you changed the hosts/io/hardware-configuration.nix file? It is specific to my disk layout, so unless you have the same layout, it will not work. I suggest running nixos-generate-config and copying that file from /etc/nixos into the hosts/io directory of the cloned repo.

@pyunramura
Copy link
Author

Oh sorry I didn't think to mention it before but I adjusted my disk configuration to match what you have configured prior to the build attempt. I just created two partitions labeled EFI and NixOS respectively on a spare ssd to test the build process. I have looked through your hardware-configuration.nix though and it matches my current configuration aside from the partition label capitalization.

I'll go ahead and post the error log here to give more info on the nature of the problem. If you'd prefer a pastebin link or otherwise I'd be happy to oblige.

NixOS build error

error:
       … while calling the 'head' builtin

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/attrsets.nix:820:11:

          819|         || pred here (elemAt values 1) (head values) then
          820|           head values
             |           ^
          821|         else

       … while evaluating the attribute 'value'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:807:9:

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

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

       error: getting status of '/mnt/nix/store/0ccnxa25whszw7mgbgyzdm4nqc0zwnm8-source/Cargo.toml': No such file or directory
Stack trace of error
error:
       … while calling anonymous lambda

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/attrsets.nix:816:24:

          815|     let f = attrPath:
          816|       zipAttrsWith (n: values:
             |                        ^
          817|         let here = attrPath ++ [n]; in

       … while calling 'g'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/attrsets.nix:599:19:

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

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/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 /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:242:72:

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

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

       … while calling anonymous lambda

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:822:28:

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

       … while evaluating definitions from `/mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/nixos/modules/system/activation/top-level.nix':

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:823:137:

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

       … while calling 'dischargeProperties'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:894:25:

          893|   */
          894|   dischargeProperties = def:
             |                         ^
          895|     if def._type or "" == "merge" then

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/nixos/modules/system/activation/top-level.nix:71:12:

           70|   # Replace runtime dependencies
           71|   system = foldr ({ oldDependency, newDependency }: drv:
             |            ^
           72|       pkgs.replaceDependency { inherit oldDependency newDependency drv; }

       … while calling 'foldr'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/lists.nix:53:20:

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

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/lists.nix:60:8:

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

       … while calling 'fold''

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/lists.nix:56:15:

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

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/nixos/modules/system/activation/top-level.nix:68:10:

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

       … while calling 'showWarnings'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/trivial.nix:414:28:

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

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/trivial.nix:414:33:

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

       … while calling 'foldr'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/lists.nix:53:20:

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

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/lists.nix:60:8:

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

       … while calling 'fold''

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/lists.nix:56:15:

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

       … while calling 'g'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/attrsets.nix:599:19:

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

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/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 /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:242:72:

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

       … while evaluating the option `warnings':

       … while calling anonymous lambda

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:822:28:

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

       … while evaluating definitions from `/mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/nixos/modules/system/boot/systemd.nix':

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:823:137:

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

       … while calling 'dischargeProperties'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:894:25:

          893|   */
          894|   dischargeProperties = def:
             |                         ^
          895|     if def._type or "" == "merge" then

       … while calling anonymous lambda

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/attrsets.nix:543:10:

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

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/attrsets.nix:543:16:

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

       … while calling anonymous lambda

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/nixos/modules/system/boot/systemd.nix:425:16:

          424|       mapAttrsToList
          425|         (name: service:
             |                ^
          426|           let

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/nixos/modules/system/boot/systemd.nix:432:16:

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

       … while calling 'optional'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/lists.nix:311:20:

          310|   */
          311|   optional = cond: elem: if cond then [elem] else [];
             |                    ^
          312|

       … while calling 'g'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/attrsets.nix:599:19:

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

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/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 /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:242:72:

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

       … while evaluating the option `systemd.services.nh-clean.serviceConfig':

       … while calling anonymous lambda

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:822:28:

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

       … while evaluating definitions from `/mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/nixos/modules/system/boot/systemd.nix':

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:823:137:

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

       … while calling 'dischargeProperties'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:894:25:

          893|   */
          894|   dischargeProperties = def:
             |                         ^
          895|     if def._type or "" == "merge" then

       … while calling 'g'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/attrsets.nix:599:19:

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

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/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 /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:242:72:

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

       … while evaluating the option `systemd.services.nh-clean.script':

       … while calling anonymous lambda

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:822:28:

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

       … while evaluating definitions from `/nix/store/v684x0mdan7pw90znhmr3a48xa1k3yww-source/flake.nix#nixosModules.default':

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:823:137:

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

       … while calling 'dischargeProperties'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/modules.nix:894:25:

          893|   */
          894|   dischargeProperties = def:
             |                         ^
          895|     if def._type or "" == "merge" then

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/pkgs/stdenv/generic/make-derivation.nix:318:9:

          317|         in
          318|         lib.strings.sanitizeDerivationName (
             |         ^
          319|           if attrs ? name

       … while calling anonymous lambda

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/strings.nix:1096:3:

         1095|   in
         1096|   string:
             |   ^
         1097|   # First detect the common case of already valid strings, to speed those up

       … from call site

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/pkgs/stdenv/generic/make-derivation.nix:323:20:

          322|             # we cannot coerce null to a string below
          323|             assert lib.assertMsg (attrs ? version && attrs.version != null) "The ‘version’ attribute cannot be null.";
             |                    ^
          324|             "${attrs.pname}${staticMarker}${hostSuffix}-${attrs.version}"

       … while calling 'assertMsg'

         at /mnt/nix/store/8lg5579v1k5mc63ypzfagrcl8l32x3bh-source/lib/asserts.nix:23:5:

           22|     # Message to throw in case `pred` fails
           23|     msg:
             |     ^
           24|     pred || builtins.throw msg;

       error: getting status of '/mnt/nix/store/0ccnxa25whszw7mgbgyzdm4nqc0zwnm8-source/Cargo.toml': No such file or directory

I'm just not certain what in the config is being built while calling that nix store path, as it seems to be failing by not being able to find the Cargo.toml.

@fufexan
Copy link
Owner

fufexan commented Oct 5, 2023

Looks like nh is the issue here. Try updating the lockfile. Or using the commit I have in mine, as it works currently.

@pyunramura
Copy link
Author

I attempted to update the lock file but it didn't seem to make a difference. I did however manage to get it deployed though by disabling nh in the config. Oddly enough once booted into the new installation I successfully rebuilt with nh enabled. The odd behavior probably points to an issue with my current deployment, though it also displayed the same behavior for me when attempting to deploy the flake from the NixOS installation media. Not really sure where the problem lies, but I haven't tried replicating the results yet. Anyway, thank you very much for the nh tip, it made all the difference. I'll consider the issue closed. Thanks again for your help.

@pyunramura
Copy link
Author

Just an additional point of reference to the problem I was seeing with viperML/nh. It seems there's a problem using nixos-install with nh as reported by this issue. Good thing to keep in mind if you're going to be doing a clean install in the future, just disable nh for the installation.

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

No branches or pull requests

2 participants