Hi all,
i wasnt able to use my nixos system for a long time(more than 6 months). Recently when i tried to install a pkg hardinfo to see if my laptop fan was running(if there is an elegant way to know about cpu fan status thing, please let me know). After making changes to my config file, i did nix flake update and nixos-rebuild switch --flake .. I ended up getting error like such
Error in adding pkg
❯ sudo nixos-rebuild switch --flake .#system
[sudo] password for mainuser:
building the system configuration...
trace: warning: mainuser profile: The option `programs.zsh.enableAutosuggestions' defined in `/nix/store/0ah8jpwgi9mqld1d8ps27wk26acm3a69-source/sh/sh.nix' has been renamed to `programs.zsh.autosuggestion.enable'.
trace: warning: The option `services.xserver.xkbVariant' defined in `/nix/store/0ah8jpwgi9mqld1d8ps27wk26acm3a69-source/configuration.nix' has been renamed to `services.xserver.xkb.variant'.
trace: warning: The option `services.xserver.layout' defined in `/nix/store/0ah8jpwgi9mqld1d8ps27wk26acm3a69-source/configuration.nix' has been renamed to `services.xserver.xkb.layout'.
trace: warning: The option `services.xserver.displayManager.sddm.enable' defined in `/nix/store/0ah8jpwgi9mqld1d8ps27wk26acm3a69-source/configuration.nix' has been renamed to `services.displayManager.sddm.enable'.
error:
… while calling the 'head' builtin
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/attrsets.nix:1575:11:
1574| || pred here (elemAt values 1) (head values) then
1575| head values
| ^
1576| else
… while evaluating the attribute 'value'
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: undefined variable 'hardinfo2'
at /nix/store/0ah8jpwgi9mqld1d8ps27wk26acm3a69-source/configuration.nix:142:5:
141| nvd
142| hardinfo2
| ^
143| # Media
I dont know why you have mentioned 23.05, but im under 24.05 currently.
When you mean release by release, is it incremental like 23.11 → 24.05 → 24.11 and so on, right ?
And regarding the warnings, i thought it was automatically taken care by the nix. Will try to fix them too. thanks for pointing out (so dumb of me )
I tried to edit the warnings as you have said. but just for confirmation when i searched under the nixos options (just out of curiosity), it said the option should be programs.zsh.autosuggestions.enable but the warning message suggested to write it as programs.zsh.autosuggestion.enable.
Thing is the warning messages suggestion worked, but the nixos options from the pkg collection site did not. (im yet to update my system from 24.05 to 24.11 - just looking for how to change from plasma 5 to plasma 6, which is taking time)
is that normal or should it be logged as an issue ?
The warning message was the one what i got before editing as per rebuilds output.
while following as per the warning message worked but as per the source programs.zsh.autosuggestions.enable. got this error
error:
… while calling the 'head' builtin
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/attrsets.nix:1575:11:
1574| || pred here (elemAt values 1) (head values) then
1575| head values
| ^
1576| else
… while evaluating the attribute 'value'
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:809:9:
808| in warnDeprecation opt //
809| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
810| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: The option `home-manager.users.mainuser.programs.zsh.autosuggestions' does not exist. Definition values:
- In `/nix/store/6r5w9vqv0dhd4pdjmx7rk820ghxx28s5-source/sh/sh.nix':
{
enable = true;
}
path '/home/mainuser/.dotfiles/sh' does not contain a 'flake.nix', searching up
building the system configuration...
path '/home/mainuser/.dotfiles/sh' does not contain a 'flake.nix', searching up
error:
… while calling anonymous lambda
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/attrsets.nix:1571:24:
1570| let f = attrPath:
1571| zipAttrsWith (n: values:
| ^
1572| let here = attrPath ++ [n]; in
… while calling anonymous lambda
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/attrsets.nix:1205:18:
1204| mapAttrs
1205| (name: value:
| ^
1206| if isAttrs value && cond value
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/attrsets.nix:1208:18:
1207| then recurse (path ++ [ name ]) value
1208| else f (path ++ [ name ]) value);
| ^
1209| in
… while calling anonymous lambda
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-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/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:824:28:
823| # Process mkMerge and mkIf properties.
824| defs' = concatMap (m:
| ^
825| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while evaluating definitions from `/nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/nixos/modules/system/activation/top-level.nix':
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:825:137:
824| defs' = concatMap (m:
825| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
826| ) defs;
… while calling 'dischargeProperties'
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:896:25:
895| */
896| dischargeProperties = def:
| ^
897| if def._type or "" == "merge" then
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-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/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/lists.nix:121:20:
120| */
121| foldr = op: nul: list:
| ^
122| let
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/lists.nix:128:8:
127| else op (elemAt list n) (fold' (n + 1));
128| in fold' 0;
| ^
129|
… while calling 'fold''
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/lists.nix:124:15:
123| len = length list;
124| fold' = n:
| ^
125| if n == len
… while calling anonymous lambda
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/attrsets.nix:1205:18:
1204| mapAttrs
1205| (name: value:
| ^
1206| if isAttrs value && cond value
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/attrsets.nix:1208:18:
1207| then recurse (path ++ [ name ]) value
1208| else f (path ++ [ name ]) value);
| ^
1209| in
… while calling anonymous lambda
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-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 `assertions':
… while calling anonymous lambda
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:824:28:
823| # Process mkMerge and mkIf properties.
824| defs' = concatMap (m:
| ^
825| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while evaluating definitions from `/nix/store/q1ss75nhmjiydyqw8lbzwbx7cqk8z0qq-source/nixos/common.nix':
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:825:137:
824| defs' = concatMap (m:
825| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
826| ) defs;
… while calling 'dischargeProperties'
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:896:25:
895| */
896| dischargeProperties = def:
| ^
897| if def._type or "" == "merge" then
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:902:11:
901| if def.condition then
902| dischargeProperties def.content
| ^
903| else
… while calling 'dischargeProperties'
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:896:25:
895| */
896| dischargeProperties = def:
| ^
897| if def._type or "" == "merge" then
… from call site
at /nix/store/q1ss75nhmjiydyqw8lbzwbx7cqk8z0qq-source/nixos/common.nix:110:20:
109|
110| assertions = flatten (flip mapAttrsToList cfg.users (user: config:
| ^
111| flip map config.assertions (assertion: {
… while calling 'flatten'
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/lists.nix:431:13:
430| */
431| flatten = x:
| ^
432| if isList x
… while calling anonymous lambda
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/lists.nix:433:21:
432| if isList x
433| then concatMap (y: flatten y) x
| ^
434| else [x];
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/lists.nix:433:24:
432| if isList x
433| then concatMap (y: flatten y) x
| ^
434| else [x];
… while calling 'flatten'
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/lists.nix:431:13:
430| */
431| flatten = x:
| ^
432| if isList x
… while calling anonymous lambda
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/attrsets.nix:1096:10:
1095| attrs:
1096| map (name: f name attrs.${name}) (attrNames attrs);
| ^
1097|
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/attrsets.nix:1096:16:
1095| attrs:
1096| map (name: f name attrs.${name}) (attrNames attrs);
| ^
1097|
… while calling anonymous lambda
at /nix/store/q1ss75nhmjiydyqw8lbzwbx7cqk8z0qq-source/nixos/common.nix:110:66:
109|
110| assertions = flatten (flip mapAttrsToList cfg.users (user: config:
| ^
111| flip map config.assertions (assertion: {
… from call site
at /nix/store/q1ss75nhmjiydyqw8lbzwbx7cqk8z0qq-source/nixos/common.nix:111:9:
110| assertions = flatten (flip mapAttrsToList cfg.users (user: config:
111| flip map config.assertions (assertion: {
| ^
112| inherit (assertion) assertion;
… while calling 'flip'
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/trivial.nix:314:16:
313| */
314| flip = f: a: b: f b a;
| ^
315|
… while calling anonymous lambda
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/types.nix:584:22:
583| merge = loc: defs:
584| mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
| ^
585| (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue
… from call site
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/modules.nix:846:59:
845| if isDefined then
846| if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
| ^
847| else let allInvalid = filter (def: ! type.check def.value) defsFinal;
… while calling 'merge'
at /nix/store/25wr1mdhyil8icqpkx5326shnlf4245l-source/lib/types.nix:888:22:
887| check = x: isAttrs x || isFunction x || path.check x;
888| merge = loc: defs:
| ^
889| (base.extendModules {
error: The option `home-manager.users.mainuser.programs.zsh.autosuggestions' does not exist. Definition values:
- In `/nix/store/6r5w9vqv0dhd4pdjmx7rk820ghxx28s5-source/sh/sh.nix':
{
enable = true;
}
JFYI, I have updated my system from 24.5 → 24.11 and now it expects as per docs/source programs.zsh.autosuggestions.enable and not autosuggestion.enable(which gave the same error as earlier)