4 packages raising "undefined variable" error
Hi there,
I'm migrating from Arch to Nix and I'm having a hard time on understanding Flakes.
I installed NixOS on my machine with the "No desktop" option. Then, I followed all the steps provided in the project's README.md file, but, when running sudo nixos-rebuild switch --flake /etc/nixos#nixos-notebook, an error message was raised, stating the following:
error: undefined variable 'surrealist'
at /nix/store/4lq861nz9q972zh5hlipdbzbqyjc1894-source/utils.nix:11:5
I tried to comment out surrealist, since it wasn't a package that important to me, then tried rerunning nixos-rebuild and it raised the same error, undefined variable, for hyprcursor. I found myself in a rabbit hole. I commented out 4 packages in total:
- utils.nix:
- surrealist
- hyprland.nix:
- hyprcursor
- hyprlock
- hypridle
After removing these packages I ran sudo nixos-rebuild switch --flake /etc/nixos#nixos-notebook again and it finished with the following message:
File system "/boot" is not a FAT EFI System Partition (ESP) file system.
systemd-boot not installed in ESP.
Traceback (most recent call last):
File "/nix/store/va2wc83qm641zsa2f0hpn2kmi77ncq3x-systemd-boot", line 344 in <module>
main()
File "/nix/store/va2wc83qm641zsa2f0hpn2kmi77ncq3x-systemd-boot", line 322 in main
install_bootloader(args)
File "/nix/store/va2wc83qm641zsa2f0hpn2kmi77ncq3x-systemd-boot", line 270, in install_bootloader
raise Exception("could not find any previously installed systemd-boot")
Exception: could not find any previously installed systemd-boot
warning: error(s) occurred while switching to the new configuration
(but it DID generate a new build)
I checked out and it seems that all the packages raising the "undefined variable" error are only available in the unstable branch of nixpkgs, but I noticed that the "flake.nix" already seems to maintain the unstable branch as the input for the flakes. Any idea on how to fix this one?
Also, I tried running sudo nixos-rebuild switch --flake /etc/nixos#nixos-notebook --show-trace > call_stack.txt but the content keeps being printed out in my CLI instead of being redirected to the file. Am I doing something wrong here?
I reinstalled NixOS with the Plasma desktop environment. The issue remains the same.
Here's the trace of sudo nixos-rebuild switch --flake /etc/nixos#nixos-pc --show-trace (I changed the hostname from "nixos-notebook" to "nixos-pc"):
~> sudo nixos-rebuild switch --flake /etc/nixos#nixos-pc --show-trace
building the system configuration...
error:
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:860:24:
859| let f = attrPath:
860| zipAttrsWith (n: values:
| ^
861| let here = attrPath ++ [n]; in
… while calling 'g'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:643:19:
642| g =
643| name: value:
| ^
644| if isAttrs value && cond value
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:646:20:
645| then recurse (path ++ [name]) value
646| else f (path ++ [name]) value;
| ^
647| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/activation/top-level.nix':
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:894:25:
893| */
894| dischargeProperties = def:
| ^
895| if def._type or "" == "merge" then
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/lists.nix:52:20:
51| */
52| foldr = op: nul: list:
| ^
53| let
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/lists.nix:59:8:
58| else op (elemAt list n) (fold' (n + 1));
59| in fold' 0;
| ^
60|
… while calling 'fold''
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/lists.nix:55:15:
54| len = length list;
55| fold' = n:
| ^
56| if n == len
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/lists.nix:52:20:
51| */
52| foldr = op: nul: list:
| ^
53| let
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/lists.nix:59:8:
58| else op (elemAt list n) (fold' (n + 1));
59| in fold' 0;
| ^
60|
… while calling 'fold''
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/lists.nix:55:15:
54| len = length list;
55| fold' = n:
| ^
56| if n == len
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/activation/top-level.nix:48:16:
47| # makes it bootable. See `activatable-system.nix`.
48| baseSystem = pkgs.stdenvNoCC.mkDerivation ({
| ^
49| name = "nixos-system-${config.system.name}-${config.system.nixos.label}";
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/pkgs/stdenv/generic/make-derivation.nix:600:3:
599| in
600| fnOrAttrs:
| ^
601| if builtins.isFunction fnOrAttrs
… while calling 'g'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:643:19:
642| g =
643| name: value:
| ^
644| if isAttrs value && cond value
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:646:20:
645| then recurse (path ++ [name]) value
646| else f (path ++ [name]) value;
| ^
647| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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.systemBuilderArgs':
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:844:59:
843| if isDefined then
844| if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
| ^
845| else let allInvalid = filter (def: ! type.check def.value) defsFinal;
… while calling 'merge'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:540:20:
539| check = isAttrs;
540| merge = loc: defs:
| ^
541| mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:541:35:
540| merge = loc: defs:
541| mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
| ^
542| (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue
… while calling 'filterAttrs'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:323:5:
322| # The attribute set to filter
323| set:
| ^
324| listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:324:29:
323| set:
324| listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
| ^
325|
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:324:62:
323| set:
324| listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
| ^
325|
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:541:51:
540| merge = loc: defs:
541| mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
| ^
542| (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:541:86:
540| merge = loc: defs:
541| mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
| ^
542| (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/activation/activatable-system.nix':
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:894:25:
893| */
894| dischargeProperties = def:
| ^
895| if def._type or "" == "merge" then
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/activation/activation-script.nix:133:18:
132| apply = set: set // {
133| script = systemActivationScript set false;
| ^
134| };
… while calling 'systemActivationScript'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/activation/activation-script.nix:20:33:
19|
20| systemActivationScript = set: onlyDry: let
| ^
21| set' = mapAttrs (_: v: if isString v then (noDepEntry v) // { supportsDryActivation = false; } else v) set;
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/activation/activation-script.nix:49:9:
48|
49| ${textClosureMap id (withDrySnippets) (attrNames withDrySnippets)}
| ^
50|
… while calling 'textClosureMap'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/strings-with-deps.nix:75:35:
74|
75| textClosureMap = f: predefined: names:
| ^
76| concatStringsSep "\n" (map f (textClosureList predefined names));
… while calling 'id'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/trivial.nix:14:5:
13| # The value to return
14| x: x;
| ^
15|
… while calling 'g'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:643:19:
642| g =
643| name: value:
| ^
644| if isAttrs value && cond value
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:646:20:
645| then recurse (path ++ [name]) value
646| else f (path ++ [name]) value;
| ^
647| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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.activationScripts.etc.text':
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/etc/etc-activation.nix':
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:894:25:
893| */
894| dischargeProperties = def:
| ^
895| if def._type or "" == "merge" then
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:860:24:
859| let f = attrPath:
860| zipAttrsWith (n: values:
| ^
861| let here = attrPath ++ [n]; in
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:565:29:
564| merge = loc: defs:
565| zipAttrsWith (name: defs:
| ^
566| let merged = mergeDefinitions (loc ++ [name]) elemType defs;
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/etc/etc.nix':
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:894:25:
893| */
894| dischargeProperties = def:
| ^
895| if def._type or "" == "merge" then
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:102:39:
101| then value
102| else { ${elemAt attrPath n} = atDepth (n + 1); };
| ^
103| in atDepth 0;
… while calling 'atDepth'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:99:17:
98| len = length attrPath;
99| atDepth = n:
| ^
100| if n == len
… while evaluating derivation 'etc'
whose name attribute is located at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/pkgs/stdenv/generic/make-derivation.nix:348:7
… while evaluating attribute 'buildCommand' of derivation 'etc'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/pkgs/build-support/trivial-builders/default.nix:87:14:
86| enableParallelBuilding = true;
87| inherit buildCommand name;
| ^
88| passAsFile = [ "buildCommand" ]
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/etc/etc.nix:54:7:
53| mkdir -p "$out/etc"
54| ${concatMapStringsSep "\n" (etcEntry: escapeShellArgs [
| ^
55| "makeEtcEntry"
… while calling 'concatMapStringsSep'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/strings.nix:117:5:
116| # List of input strings
117| list: concatStringsSep sep (map f list);
| ^
118|
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/etc/etc.nix:54:33:
53| mkdir -p "$out/etc"
54| ${concatMapStringsSep "\n" (etcEntry: escapeShellArgs [
| ^
55| "makeEtcEntry"
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/nixos/modules/system/etc/etc.nix:54:43:
53| mkdir -p "$out/etc"
54| ${concatMapStringsSep "\n" (etcEntry: escapeShellArgs [
| ^
55| "makeEtcEntry"
… while calling 'concatMapStringsSep'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/strings.nix:117:5:
116| # List of input strings
117| list: concatStringsSep sep (map f list);
| ^
118|
… while calling 'escapeShellArg'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/strings.nix:443:20:
442| */
443| escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
| ^
444|
… while calling 'g'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:643:19:
642| g =
643| name: value:
| ^
644| if isAttrs value && cond value
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:646:20:
645| then recurse (path ++ [name]) value
646| else f (path ++ [name]) value;
| ^
647| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 `environment.etc.dbus-1.source':
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:844:17:
843| if isDefined then
844| if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
| ^
845| else let allInvalid = filter (def: ! type.check def.value) defsFinal;
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:844:22:
843| if isDefined then
844| if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
| ^
845| else let allInvalid = filter (def: ! type.check def.value) defsFinal;
… while calling 'check'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:493:15:
492| descriptionClass = "noun";
493| check = x: isStringLike x && builtins.substring 0 1 (toString x) == "/";
| ^
494| merge = mergeEqualOption;
… while evaluating derivation 'dbus-1'
whose name attribute is located at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/pkgs/stdenv/generic/make-derivation.nix:348:7
… while evaluating attribute 'serviceDirectories' of derivation 'dbus-1'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/pkgs/development/libraries/dbus/make-dbus-conf.nix:18:12:
17| {
18| inherit serviceDirectories suidHelper apparmor;
| ^
19| preferLocalBuild = true;
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:511:14:
510| merge = loc: defs:
511| map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
| ^
512| imap1 (m: def':
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:844:17:
843| if isDefined then
844| if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
| ^
845| else let allInvalid = filter (def: ! type.check def.value) defsFinal;
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:844:22:
843| if isDefined then
844| if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
| ^
845| else let allInvalid = filter (def: ! type.check def.value) defsFinal;
… while calling 'check'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:493:15:
492| descriptionClass = "noun";
493| check = x: isStringLike x && builtins.substring 0 1 (toString x) == "/";
| ^
494| merge = mergeEqualOption;
… while evaluating derivation 'system-path'
whose name attribute is located at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/pkgs/stdenv/generic/make-derivation.nix:348:7
… while evaluating attribute 'passAsFile' of derivation 'system-path'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/pkgs/build-support/trivial-builders/default.nix:88:7:
87| inherit buildCommand name;
88| passAsFile = [ "buildCommand" ]
| ^
89| ++ (derivationArgs.passAsFile or []);
… while calling 'g'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:643:19:
642| g =
643| name: value:
| ^
644| if isAttrs value && cond value
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/attrsets.nix:646:20:
645| then recurse (path ++ [name]) value
646| else f (path ++ [name]) value;
| ^
647| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 `environment.systemPackages':
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:844:59:
843| if isDefined then
844| if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
| ^
845| else let allInvalid = filter (def: ! type.check def.value) defsFinal;
… while calling 'merge'
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:510:20:
509| check = isList;
510| merge = loc: defs:
| ^
511| map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:511:35:
510| merge = loc: defs:
511| map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
| ^
512| imap1 (m: def':
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/lists.nix:164:29:
163| */
164| imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
| ^
165|
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/lists.nix:164:32:
163| */
164| imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
| ^
165|
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/types.nix:512:21:
511| map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
512| imap1 (m: def':
| ^
513| (mergeDefinitions
… while calling anonymous lambda
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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/b90bkyadj18n26a500mwkqkmq9gz8xsr-source/utils.nix':
… from call site
at /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-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 /nix/store/aiv01710wqn2b7hms2253d1cq89kdzh8-source/lib/modules.nix:894:25:
893| */
894| dischargeProperties = def:
| ^
895| if def._type or "" == "merge" then
error: undefined variable 'surrealist'
at /nix/store/b90bkyadj18n26a500mwkqkmq9gz8xsr-source/utils.nix:11:5:
10| surrealdb-migrations
11| surrealist
| ^
12| ];
Hi @XNM1 , any ideas on how to fix this issue?
@XNM1 any ideas? i have same error
Hi, sorry for the delay in responding. I have some suggestions regarding the errors you're encountering:
-
Error ('undefined variable'): It appears you're trying to rebuild your system using Nixpkgs version 23.11. This version does not include the four packages causing the errors. Here are some possible solutions:
-
Change your Nixpkgs channel: Update your system's channel to either
nixos-24.05(stable) ornixos-unstable(latest). You can do this using the command:nix-channel --add https://nixos.org/channels/nixos-24.05 nixos # Or nix-channel --add https://nixos.org/channels/nixos-unstable nixos(I personally set my channel in the
~/.nix-channelsfile, and it usually works well. However, something might have changed in newer versions, or you might need to double-check if the necessary file was copied from my config to your home directory before rebuilding.) -
Comment out undefined packages: Temporarily comment out the lines in your configuration referencing the undefined packages. Rebuild your system, then uncomment the lines and rebuild again. This might help resolve dependency issues.
-
-
Error ('File system "/boot" is not a FAT EFI System Partition (ESP) file system'): This error could suggests a mismatch between the boot directory you specified during installation and the default NixOS boot directory (
/boot). Additionally, it could be an issue with the boot partition format. Here's what you can try:-
Manually set the boot directory: In
nixos/bootloader.nixfile, add the following line:boot.loader.efi.efiSysMountPoint = "/boot/efi";(In your case I think it is
/boot/efi, but if it's different, replace/boot/efiwith your actual boot directory.) -
Reinstall with the correct boot partition: If the above doesn't work, consider reinstalling your system, ensuring you correctly set up an EFI System Partition (ESP) during installation.
-
I solved the problem with hyprcursor, hyprlock and hypridle packages with run sudo nix flake update before running nixos-rebuild
I found a solution for the problem of missing the latest packages when applying the configuration. From now on, I suggest using the following command instead of sudo nixos-rebuild switch --flake /etc/nixos#your-hostname:
sudo nixos-rebuild switch --flake /etc/nixos#your-hostname --update-input nixpkgs --update-input rust-overlay --commit-lock-file --upgrade
This command updates channels in the flake to the latest and applies the settings.
I've already updated the README with these changes.